codingtests/solutions/ProjectEuler/015/solve.rb
2024-07-01 13:49:44 +00:00

11 lines
180 B
Ruby

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