Practice Second Minimum Time to Reach Destination
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Second Minimum Time to Reach Destination
Problem Statement
The graph has n vertices and each edges[i] = [u,v] is an undirected connection. Travel from vertex 1 to n in the undirected graph, taking time minutes per edge. All signals begin green and switch together every change minutes. You may enter on either color but can depart only on green, and must depart immediately when green. Revisiting any vertex is allowed. Return the smallest arrival time strictly greater than the minimum possible arrival time.
Source: Second Minimum Time to Reach Destination on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
n = 5, edges = [[1,2],[1,3],[1,4],[3,4],[4,5]], time = 3, change = 5
13
# Example 2
n = 2, edges = [[1,2]], time = 3, change = 2
11
Constraints
Related LeetCode Problems
Practice more problems similar to Second Minimum Time to Reach Destination.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.