2699 - Modify Graph Edge Weights
JAVA class Solution { private final int inf = 2000000000 ; public int [][] modifiedGraphEdges ( int n , int [][] edges , int source , int destination , int target ) { long d = dijkstra ( edges , n , source , destination ); if ( d < target ) { return new int [ 0 ][]; } boolean ok = d == target ; for ( var e : edges ) { if ( e [ 2 ] > 0 ) { continue ; } if ( ok ) { e [ 2 ] = inf ; continue ; } e [ 2 ] = 1 ; d = dijkstra ( edges , n , source , destination ); if ( d <= target ) { ok = true ; e [ 2 ] += target - d ; } } return ok ? edges : new int [ 0 ][]; } private long dijkstra ( int [][] edges , int n , int src , ...