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.
- Prepare
- Algorithms
- Graph Theory
- Rust & Murderer
- Discussions
Rust & Murderer
Rust & Murderer
Sort by
recency
|
67 Discussions
|
Please Login in order to post a comment
For Solving this question here is my submission: 1- Find the adjacency list of compliment of the graph (this will be representing the village roads) 2- Run he BFS with shortest distance
This is the simplest method in which this problem can be solved
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Rust & Murderer Problem Solution
Here is the solution of Rust & Murderer Click here
If someone is having runtime error in test cases 1, 2, 4 and 5, take into account that the "s" node may not have main road connections.