Company: Uber_all
Difficulty: medium
Earliest Service Times Problem Description A ride-hailing startup is prototyping a model of its city network, where each intersection is a node in a graph and each road connecting two intersections is an edge. The city has n intersections, labeled 1 to n , and m bidirectional roads. The i-th road connects road_end1[i] and road_end2[i] and takes traveling_time[i] minutes to drive across. Traffic rules mean intersection i shuts down for good at time close_time[i] , and once that happens no vehicle may enter it. Arriving at an intersection at the exact instant it shuts down still counts as failing to reach it. A trip begins at intersection 1 at time 0. Work out the earliest possible arrival time at every intersection, reporting -1 for any intersection that can never be reached. Examples Example 1: Input: n = 4, m = 4 close_time = [1, 2, 7, 9] road_end1 = [1, 1, 2, 3] road_end2 = [2, 3, 3, 4] traveling_time = [2, 5, 1, 3] Output: [0, -1, 5, 8] Explanation: The trip begins at vertex 1 at ti