Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use Dijkstra’s algorithm, but only visit nodes if you can reach them before disappearance.
Solve with full IDE support and test cases