Find every possible path from node 0 to node n-1 in a directed acyclic graph.
Constraints
Example
>>> all_paths_source_target([[1,2],[3],[3],[]]) [[0,1,3],[0,2,3]] >>> all_paths_source_target([[1],[]]) [[0,1]] >>> all_paths_source_target([[1,2,3],[2],[3],[]]) [[0,1,2,3],[0,2,3],[0,3]]
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints