"""
Exercise 2: All Paths From Source to Target (LeetCode 797)

graph is a DAG given as adjacency lists. Return all paths from node 0 to
node n - 1 (any order). DFS with a path list; no visited set is needed
because a DAG has no cycles.
"""

def all_paths_source_target(graph):
    # TODO
    return []


# --- self-check: do not modify below this line ---
a = sorted(all_paths_source_target([[1, 2], [3], [3], []]))
b = len(all_paths_source_target([[4, 3, 1], [3, 2, 4], [3], [4], []]))
print(a, b)
print("PASS" if a == [[0, 1, 3], [0, 2, 3]] and b == 5 else "FAIL")
