(
List<List<Integer>> ans,
int[][] graph,
List<Integer> list,
int i
)
| 9 | } |
| 10 | |
| 11 | public void dfs( |
| 12 | List<List<Integer>> ans, |
| 13 | int[][] graph, |
| 14 | List<Integer> list, |
| 15 | int i |
| 16 | ) { |
| 17 | if (i == graph.length - 1) { |
| 18 | ans.add(new ArrayList<Integer>(list)); |
| 19 | return; |
| 20 | } |
| 21 | for (int val : graph[i]) { |
| 22 | list.add(val); |
| 23 | dfs(ans, graph, list, val); |
| 24 | list.remove(list.size() - 1); |
| 25 | } |
| 26 | } |
| 27 | } |
no test coverage detected