Practice The Time When the Network Becomes Idle
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
There are patience.length servers, and edges[i] = [u,v] is an undirected connection. Server 0 is the master in a connected undirected graph. At second 0, every other server sends a message along a shortest path; each edge takes one second. The master instantly replies along the reverse path. Until its first reply arrives, server i resends every patience[i] seconds, checking arrivals before resending at that second. Existing messages still receive replies. Return the earliest second with no messages traveling or arriving anywhere.
Source: The Time When the Network Becomes Idle on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
edges = [[0,1],[1,2]], patience = [0,2,1]
8
# Example 2
edges = [[0,1],[0,2],[1,2]], patience = [0,10,10]
3
Constraints
Related LeetCode Problems
Practice more problems similar to The Time When the Network Becomes Idle.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.