Problem 802 · Medium
Peel off terminal nodes by reversing edges: a node is safe once all its out-neighbours are safe.
Open the interactive visualisation