Skip to content

Latest commit

 

History

History

minimum-cost-to-reach-city-with-discounts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

< Previous                  Next >

Related Topics

[Graph] [Shortest Path]

Hints

Hint 1 Try to construct a graph out of highways. What type of graph is this?
Hint 2 We essentially need to find the minimum distance to get from node 0 to node n - 1 in an undirected weighted graph. What algorithm should we use to do this?
Hint 3 Use Dijkstra's algorithm to find the minimum weight path. Keep track of the minimum distance to each vertex with d discounts left