Ad
  • Custom User Avatar

    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

  • Custom User Avatar

    This solution is 30 times slower than mine :) Indeed to understand recursion you have to understand recursion first ;)

  • Custom User Avatar

    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).

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution