Search
⌘K

Leetcode 2699. Modify Graph Edge Weights

Given an undirected weighted graph where some edges have weight -1 (modifiable) and others are fixed, assign positive integer weights (in [1, 2e9]) to the -1 edges so that the shortest-path distance from source to destination equals a given target, or report impossibility. The core challenge is finding weight assignments that exactly match the target shortest-path length while respecting the fixed edges and shortest-path structure.


Question Timeline

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

Comments

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