project_euler.problem_015.sol1 ============================== .. py:module:: project_euler.problem_015.sol1 .. 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? Attributes ---------- .. autoapisummary:: project_euler.problem_015.sol1.n Functions --------- .. autoapisummary:: project_euler.problem_015.sol1.solution Module Contents --------------- .. py:function:: solution(n: int = 20) -> int Returns the number of paths possible in a n x n grid starting at top left corner going to bottom right corner and being able to move right and down only. >>> solution(25) 126410606437752 >>> solution(23) 8233430727600 >>> solution(20) 137846528820 >>> solution(15) 155117520 >>> solution(1) 2 .. py:data:: n