Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This algorithm actually gets exponentially slower as the number increases, so you can't really compare its speed in a 1:1 manner.
2.4.1 :061 > Benchmark.measure { pascalsTriangle(25) }
=> @real=0.000426109
2.4.1 :066 > Benchmark.measure { pascalsTriangle(125) }
=> @real=0.09114601
2.4.1 :062 > Benchmark.measure { pascalsTriangle(250) }
=> @real=3.03741528
2.4.1 :067 > Benchmark.measure { pascalsTriangle(500) }
=> @real=21.5128502
This solution is 30 times slower than mine :) Indeed to understand recursion you have to understand recursion first ;)
Would be nice to define ALPHABET so the submissions don't have to, as well as specify the problem text first, and then it's source info.
Also maybe set a rule/test on ALPHABET needing to be used (to prevent self-defined nato translations).
Y U NO DRY 'Ho'
This comment is hidden because it contains spoiler information about the solution