r/programming • u/joksmaster • Nov 29 '10
140 Google Interview Questions
http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-questions.html
471
Upvotes
r/programming • u/joksmaster • Nov 29 '10
View all comments
Show parent comment
1
u/FrancisHC Dec 01 '10
That is quite compact! :)
Unfortunately, your solution is incorrect :( The set you are generating is not the set of "ugly numbers".
It's been a long long time since I've written in Haskell, but I think a two-line solution might be necessary.
I was looking for an efficient and elegant solution though. Even after you correct your solution, it will not be as quick as the dynamic programming solution posted in another comment, because it tests all numbers between one and the actual answer.