I have already checked others solutions but i am unable to figure out, how they are solving this problem. https://www.hackerrank.com/challenges/castle-on-the-grid
And if anyone can help suggest where i should study from to begin to comprehend such problems,that would be great.
What you link to is a classic shortest-path problem anf those are typically solved with breadth-first algorithms.
You should read up on Dijkstras bfs and A*.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments