Problem 1059 · Medium

All Paths from Source Lead to Destination

Check that every route from the source ends at the destination: no cycles, no dead ends elsewhere, and no way out of the destination.

Open the interactive visualisation