<awangdev>261. Graph Valid Tree_1.java
private Map<Integer, Set<Integer>> buildGraph(int n, int[][] edges) {

        Map<Integer, Set<Integer>> graph = new HashMap<>();
        for (int i = 0; i < n; i++) graph.putIfAbsent(i, new HashSet<>());
        
        for (int[] edge: edges) { 
            graph.get(edge[0]).add(edge[1]);
            graph.get(edge[1]).add(edge[0]);
        }
        return graph;
    }
private Map < Integer , Set < Integer >> var_2 ( int var_3 , int [ ] [ ] var_4 ) {
  Map < Integer , Set < Integer >> var_7 = new HashMap < > ( ) ;
  for ( int var_9 = 0 ;
  var_9 < var_3 ;
  var_9 ++ ) var_7 . putIfAbsent ( var_9 , new HashSet < > ( ) ) ;
  for ( int [ ] var_12 : var_4 ) {
    var_7 . get ( var_12 [ 0 ] ) . add ( var_12 [ 1 ] ) ;
    var_7 . get ( var_12 [ 1 ] ) . add ( var_12 [ 0 ] ) ;
  }
  return var_7 ;
}
