codingtests/ProjectEuler/015/solve.rb

11 lines
180 B
Ruby
Raw Normal View History

2012-03-09 09:34:27 +00:00
GRID_SIZE = 20
def factorial(num)
if(num == 0)
return 1
else
return num * factorial(num - 1)
end
end
puts factorial(2 * GRID_SIZE) / factorial(GRID_SIZE) ** 2