Search
⌘K

Leetcode 2714. Find Shortest Path with K Hops

Given a weighted graph, find the minimum-cost path from a source to a destination using at most K hops (edges), which forces you to track hop count alongside node state rather than using a plain shortest-path algorithm. This requires DP or layered-state graph techniques (e.g., Bellman-Ford variants, state-expanded Dijkstra, or matrix exponentiation) to handle cycles and large K efficiently.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.