Sponsored
Use these hints if you're stuck. Try solving on your own first.
Consider a new graph where each node is one of the old nodes at a specific time. For example, node 0 at time 5.
You need to find the shortest path in the new graph.
Solve with full IDE support and test cases