Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers
by nileshtrivedi on Friday January 06, 2012 @01:24AM
(#3432265)
Here is my version. Took me less than 5 minutes and worked the first time:
[ Parent
| on HN ]
Re:Why 37signals Doesn't Hire Programmers Based on Brainteasers
by mbernstein on Friday January 06, 2012 @02:03AM
(#3432358)
Recursion in this case - generally in ruby as well - is not a great idea. Also, you have quite high memory requirements: O(n^2)
O(n) is quite easy in this problem.