3 ms·
Or the even-less-computationally-intensive algorithm: http://en.wikipedia.org/wiki/Pascals_triangle#Calculating_an_individual_row_or_diagonal_by_itself http://e
by derefr 15y ago
Or the even-less-computationally-intensive algorithm: http://en.wikipedia.org/wiki/Pascals_triangle#Calculating_an_individual_row_or_diagonal_by_itself http://en.wikipedia.org/wiki/Pascals_triangle#Calculating_an...
- Bootvis 15y agoVery nice but expecting the candidate to know that much about Pascals triangle upfront seems a bit too much ;)
- lightcatcher 15y agoThats what dspeyer did here: http://news.ycombinator.com/item?id=3431687 http://news.ycombinator.com/item?id=3431687 . For an algorithms heavy job, I would hope a candidate would be able to derive this equation with a little guidance (ie, reminding them about n choose k and how to write that with factorials)