Company: Uber_all
Difficulty: medium
Earliest Service Times Problem Description Uber is testing a city ride network simulation, where intersections are represented as nodes in a graph, and the roads connecting them are represented as edges. 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. However, due to traffic regulations, each intersection i closes permanently at time close_time[i] and cannot be entered afterwards. If a driver arrives at an intersection at the exact time it closes, it is considered unreachable. A ride starts at intersection 1 at time 0. Your task is to determine the earliest time each intersection can be reached. If an intersection is unreachable, return -1. 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 ride starts at vertex 1 at time 0.