Skip to content

Instantly share code, notes, and snippets.

@betaprojects
Last active September 11, 2020 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betaprojects/26fbeec9b298bd56a5b35f3e47c59cd9 to your computer and use it in GitHub Desktop.
Save betaprojects/26fbeec9b298bd56a5b35f3e47c59cd9 to your computer and use it in GitHub Desktop.
Project Euler & HackerRank problem 15 solution: Lattice paths - solved using Python
from math import factorial as f
n, m = map(int, input("Enter dimensions (separate by space)?").split())
print ("Routes through a", n, "x", m, "grid", f(n+m) // f(n) // f(m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment