Hello coders, I really want your help to code this problem in python using heapq or priority queue.
Link: https://www.geeksforgeeks.org/minimize-cost-to-reach-end-of-an-n-length-straight-path/
I have tried my best, following code if you want to debug it, the problem is the output isn’t minized cost and seems that I failed to convert the java code into python.
Code:
using priority q library: priorityQuest - Pastebin.com
using heapq library: heapqQues - Pastebin.com
The output for this should be 40, but I m getting 48.
Please help me debug this, I’d really appreciate it, thank you.