Thursday, August 14, 2014

Project Euler Problem 15 Solution

Lattice paths

Problem 15

Published on 19 April 2002 at 06:00 pm [Server Time]
Starting in the top left corner of a 2×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×20 grid?


Solution = 137846528820



Explanation:

Honestly I could not solve it completely, but was on right track as I got the idea of dynamic programming and extra 1 dimension for the total points.

Nevertheless, please follow the link:
http://www.mathblog.dk/project-euler-15/

Very neatly explained!

Following is the Python implementation code:
https://github.com/dkuldeep11/project-euler/blob/master/problem15/p15.py

No comments:

Post a Comment