Last November I solved Problem 15 of Project Euler (a counting problem involving paths in square grids), and, although the problem admits a simple solution, some of the solutions presented in their forums are very complicated. Thus, I thought it would be a good idea to present my solution, as I consider it very simple.
Problem statement Starting in the top left corner of a $2{\times}2$ grid, there are 6 routes (without backtracking) to the bottom right corner.

© 2006—2023 João F. Ferreira. All opinions are personal and do not necessarily represent the entities I am affiliated with.

Published with Wowchemy — the free, open source website builder that empowers creators.