comefrom: <awangdev>1203. Sort Items by Groups Respecting Dependencies_4.java
code: private Map<Integer, List<Integer>> buildGroupGraph(int n, int[] group, List<List<Integer>> beforeItems) {
  
          Map<Integer, List<Integer>> graph = new HashMap<>();
          for (int i = 0; i < n; i++) {
              int groupId = group[i];
              for (int item : beforeItems.get(i)) {
                  if (groupId == group[item]) continue;
                  graph.putIfAbsent(group[item], new ArrayList<>());
                  graph.get(group[item]).add(groupId);
              }
          }
          return graph;
      }
masked: private Map < Integer , List < Integer >> var_2 ( int var_3 , int [ ] var_4 , List < List < Integer >> var_5 ) {
    Map < Integer , List < Integer >> var_8 = new HashMap < > ( ) ;
    for ( int var_10 = 0 ;
    var_10 < var_3 ;
    var_10 ++ ) {
      int var_11 = var_4 [ var_10 ] ;
      for ( int var_13 : var_5 . get ( var_10 ) ) {
        if ( var_11 == var_4 [ var_13 ] ) continue ;
        var_8 . putIfAbsent ( var_4 [ var_13 ] , new ArrayList < > ( ) ) ;
        var_8 . get ( var_4 [ var_13 ] ) . add ( var_11 ) ;
      }
    }
    return var_8 ;
  }
  