All Paths From Source to Target

Given a directed acyclic graph represented as an adjacency list, find all possible paths from node 0 (source) to node n-1 (target). Return all paths as a list of lists.

Examples
Input: [[1,2],[3],[3],[]]
Output: [[0,1,3],[0,2,3]]
Hints

All Paths From Source to Target

Given a directed acyclic graph represented as an adjacency list, find all possible paths from node 0 (source) to node n-1 (target). Return all paths as a list of lists.