Hard · Weighted Graph
Dijkstra
Relax weighted edges with a priority queue.
Reference test case
Input: [2, 7, 11, 15], target = 9 Expected output: [0, 1]
Hard · Weighted Graph
Relax weighted edges with a priority queue.
Input: [2, 7, 11, 15], target = 9 Expected output: [0, 1]