We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
i also nearly wanted to quit.
Then i started to analyse with spreadsheet how numbers (count of paths) evolve using a simple, but slow solution just adding step by step, when adding n by n and m by m and how this relates to number of turns.
And then i got functions for 1,2,3,4,5,6,... turns and then i saw similarities from 8,9,10,11 turns and turned this into a recursion and voila ... finished.
... ok ... took a view weeks playing with a lot of numbers :)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and the Maze
You are viewing a single comment's thread. Return to all comments →
i also nearly wanted to quit. Then i started to analyse with spreadsheet how numbers (count of paths) evolve using a simple, but slow solution just adding step by step, when adding n by n and m by m and how this relates to number of turns. And then i got functions for 1,2,3,4,5,6,... turns and then i saw similarities from 8,9,10,11 turns and turned this into a recursion and voila ... finished. ... ok ... took a view weeks playing with a lot of numbers :)