JAVA_LeetCode 1971_Find if Path Exists in Graph 풀이 class Solution { public void dfs(int idx, boolean[] b, List nodeList, List list){ b[idx] = true; list.add(idx); for(int node : nodeList.get(idx)){ if(!b[node]) dfs(node, b, nodeList, list); } } public boolean validPath(int n, int[][] edges, int source, int destination) { boolean[] b = new boolean[n]; List list = new ArrayList(); List
nodeList = new ArrayList(); for (int i = 0; i < n; i++) nodeL...
#
JAVA
#
JAVA_FindifPathExistsinGraph
#
JAVA_LeetCode1971
#
JAVA_LeetCode1971_FindifPathExistsinGraph
#
LeetCode1971_FindifPathExistsinGraph