comefrom: <awangdev>261. Graph Valid Tree_2.java
code: private boolean dfs(Map<Integer, Set<Integer>> graph, Set<Integer> visited, int curr, int pre) {
  
          if (visited.contains(curr)) return false;
          visited.add(curr);
          for (int child : graph.get(curr)) {
              if (child == pre) continue;
              if (!dfs(graph, visited, child, curr)) return false;
          }
          return true;
      }
masked: private boolean sample_funcname ( Map < Integer , Set < Integer >> graph , Set < Integer > visited , int curr , int pre ) {
    if ( visited . contains ( curr ) ) return false ;
    visited . add ( curr ) ;
    for ( int child : graph . get ( curr ) ) {
      if ( child == pre ) continue ;
      if ( ! dfs ( graph , visited , child , curr ) ) return false ;
    }
    return true ;
  }
  