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.
In this case : since ladder is present to 99, you'll definitely get solution because of second step "Ladders" as described in previous comment above. Else if there was no solution (no ladder to 99) just print -1 as mentioned in problem statement.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Snakes and Ladders: The Quickest Way Up
You are viewing a single comment's thread. Return to all comments →
In this case : since ladder is present to 99, you'll definitely get solution because of second step "Ladders" as described in previous comment above. Else if there was no solution (no ladder to 99) just print
-1
as mentioned in problem statement.