Problem 797 · Medium

All Paths From Source to Target

Backtracking DFS over a DAG from node 0, recording the path whenever node n-1 is reached.

Open the interactive visualisation