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.
Minimum Penalty Path
Minimum Penalty Path
Sort by
recency
|
58 Discussions
|
Please Login in order to post a comment
For python code, at the begining I had a lot of test cases with time limit. I did a lot of tweaking and solved most of them. However, I could not pass test case 2. I changed the way I read input, as a result the prblem was solved.
if name == 'main': # Read all input at once using sys.stdin.read() input_data = sys.stdin.read().splitlines()
Golang solution just in case someone is looking. NOTE: Dijkstra will not work as explained [here]https://www.hackerrank.com/challenges/beautiful-path/forum/comments/121506). We need to go with brute force as input size is small, so a simple dfs/bfs needed to check all possible distances of a vertex from starting vertex(in this case 'A').
Here is my solution in java, javascript, python, C, C++, csharp HackerRank Minimum Penalty Path Solution
Hi There! i want to use it for my Gaming Website .
Here is the solution of Minimum Penalty Path Click Here