Problem 15
Starting in the top left corner of a 2x2 grid, there are 6 routes (without backtracking) to the bottom right corner.
How many routes are there through a 20x20 grid?
Integerを使えば簡単。
p015 n = product[n+1..2*n]`div`product[1..n]
Starting in the top left corner of a 2x2 grid, there are 6 routes (without backtracking) to the bottom right corner.
How many routes are there through a 20x20 grid?
Integerを使えば簡単。
p015 n = product[n+1..2*n]`div`product[1..n]