2699. Modify Graph Edge Weights
You are given an undirected weighted connected graph containing
nnodes labeled from0ton - 1, and an integer arrayedgeswhereedges[i] = [ai, bi, wi]indicates that there is an edge between nodesaiandbiwith weightwi.Some edges have a weight of
-1(wi = -1), while others have a positive weight (wi > 0).Your task is to modify all edges with a weight of
-1by assigning them positive integer values in the range[1, 2 * 109]so that the shortest distance between the nodessourceanddestinationbecomes equal to an integertarget. If there are multiple modifications that make the shortest distance betweensourceanddestinationequal totarget, any of them will be considered correct.Return an array containing all edges (even unmodified ones) in any order if it is possible to make the shortest distance from
sourcetodestinationequal totarget, or an empty array if it’s impossible.Note: You are not allowed to modify the weights of edges with initial positive weights.