Problem
Compute how long it takes for all nodes to receive a signal from the source.
Example 1
Input: times = [[2,1,1],[2,3,1],[3,4,1]], n = 4, k = 2
Output: 2
Constraints
- 1 <= k <= n <= 100
Notes
- Focus on the underlying shortest path pattern.
- Write the cleanest correct solution before optimizing further.
- Hidden tests cover larger edge cases than the visible examples.