alonsovidales / facebook-programming-challenges

This is a compilation of possible questions to be solved in order to be hired by Facebook
159 stars 54 forks source link

Reduce staves runtime on input01 from 15 to 3 seconds #7

Open jamarshon opened 7 years ago

jamarshon commented 7 years ago

An optimized solution that is N^3 using a hashmap to make queries faster. On the large test case it runs 5 times faster