Euler 15 in Python
This one isn’t even funny…
Starting in the top left corner of a grid, there are 6 routes (without backtracking) to the bottom right corner.

How many routes are there through a grid?
Your first thought would be to generate the routes, but for a grid, those amount to BILLIONS and you’d try to do it recursively too! Forget it.
But if you have some CompSci-level math background, though, you’ll remember this one—reading The Art of Computer Programming, Vol. 4 also helps. It’s a matter of combinatorics and if we take for the width and for the height, all we need to calculate is:
Every path consists of exactly 20 moves right and 20 moves down. Choosing which 20 of the 40 positions are right moves uniquely determines a path, so the answer is the binomial coefficient .
from math import comb
width = height = 20
print(comb(width + height, width))
math.comb computes the integer result directly, without constructing three
factorials. The answer is 137846528820.