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.
Well, you can find a DP solution by generalising. Instead of calculating the number of all pathes to (i, j), we can calculate the number of all pathes entering to (i, j) from a certain direction. And when does it exactly make a turn?
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 →
Well, you can find a DP solution by generalising. Instead of calculating the number of all pathes to (i, j), we can calculate the number of all pathes entering to (i, j) from a certain direction. And when does it exactly make a turn?