<awangdev>Number of Connected Components in an Undirected Graph_1.java
private Map<Integer, List<Integer>> buildGraph(int n, int[][] edges) {

        Map<Integer, List<Integer>> graph = new HashMap<>();
        for (int i = 0; i < n; i++) {
            if (!graph.containsKey(i)) {
                graph.put(i, new ArrayList<>());
            }
        }
        for (int[] edge: edges) {
            graph.get(edge[0]).add(edge[1]);
            graph.get(edge[1]).add(edge[0]);
        }
        return graph;
    }
private Map < Integer , List < Integer >> var_2 ( int var_3 , int [ ] [ ] var_4 ) {
  Map < Integer , List < Integer >> var_7 = new HashMap < > ( ) ;
  for ( int var_9 = 0 ;
  var_9 < var_3 ;
  var_9 ++ ) {
    if ( ! var_7 . containsKey ( var_9 ) ) {
      var_7 . put ( var_9 , new ArrayList < > ( ) ) ;
    }
  }
  for ( int [ ] var_13 : var_4 ) {
    var_7 . get ( var_13 [ 0 ] ) . add ( var_13 [ 1 ] ) ;
    var_7 . get ( var_13 [ 1 ] ) . add ( var_13 [ 0 ] ) ;
  }
  return var_7 ;
}
