project_euler.problem_015.sol2 ============================== .. py:module:: project_euler.problem_015.sol2 .. autoapi-nested-parse:: Problem 15: https://projecteuler.net/problem=15 Starting in the top left corner of a 2x2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner. How many such routes are there through a 20x20 grid? Functions --------- .. autoapisummary:: project_euler.problem_015.sol2.solution Module Contents --------------- .. py:function:: solution(n: int = 20) -> int Solve by explicitly counting the paths with dynamic programming. >>> solution(6) 924 >>> solution(2) 6 >>> solution(1) 2