Symbol(clack:cancel)

This commit is contained in:
2025-12-26 17:35:14 +08:00
parent 266544ac47
commit 25469e1022
54 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
"""
Starting in the top left corner of a 2 X 2 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 20 X 20 grid?
"""
import math
def grid_paths(m: int, n: int) -> int:
return math.comb(m + n, m)
def main() -> None:
print(grid_paths(20, 20))
if __name__ == "__main__":
main()