comefrom: <gouthampradhan>array_RelativeSortArray_1.java
code: public int[] relativeSortArray(int[] arr1, int[] arr2) {
      List<Integer> notPresent = new ArrayList<>();
      Map<Integer, Integer> map = new HashMap<>();
      Set<Integer> set = new HashSet<>();
      for (int i : arr2) {
        set.add(i);
      }
      for (int i : arr1) {
        map.putIfAbsent(i, 0);
        map.put(i, map.get(i) + 1);
      }
      List<Integer> result = new ArrayList<>();
      for (int i : arr2) {
        int count = map.get(i);
        for (int j = 0; j < count; j++) {
          result.add(i);
        }
      }
      for (int k : map.keySet()) {
        if (!set.contains(k)) {
          int count = map.get(k);
          for (int i = 0; i < count; i++) {
            notPresent.add(k);
          }
        }
      }
      notPresent.sort(Comparator.comparingInt(o -> o));
      result.addAll(notPresent);
      int[] resA = new int[result.size()];
      for (int i = 0; i < result.size(); i++) {
        resA[i] = result.get(i);
      }
      return resA;
    }
masked: public int [ ] sample_funcname ( int [ ] var_0 , int [ ] var_1 ) {
    List < Integer > var_5 = new ArrayList < > ( ) ;
    Map < Integer , Integer > var_8 = new HashMap < > ( ) ;
    Set < Integer > var_11 = new HashSet < > ( ) ;
    for ( int var_12 : var_1 ) {
      var_11 . add ( var_12 ) ;
    }
    for ( int var_12 : var_0 ) {
      var_8 . putIfAbsent ( var_12 , 0 ) ;
      var_8 . put ( var_12 , var_8 . get ( var_12 ) + 1 ) ;
    }
    List < Integer > var_19 = new ArrayList < > ( ) ;
    for ( int var_12 : var_1 ) {
      int var_20 = var_8 . get ( var_12 ) ;
      for ( int var_21 = 0 ;
      var_21 < var_20 ;
      var_21 ++ ) {
        var_19 . add ( var_12 ) ;
      }
    }
    for ( int var_23 : var_8 . keySet ( ) ) {
      if ( ! var_11 . contains ( var_23 ) ) {
        int var_20 = var_8 . get ( var_23 ) ;
        for ( int var_12 = 0 ;
        var_12 < var_20 ;
        var_12 ++ ) {
          var_5 . add ( var_23 ) ;
        }
      }
    }
    var_5 . sort ( Comparator . comparingInt ( var_28 -> var_28 ) ) ;
    var_19 . addAll ( var_5 ) ;
    int [ ] var_31 = new int [ var_19 . size ( ) ] ;
    for ( int var_12 = 0 ;
    var_12 < var_19 . size ( ) ;
    var_12 ++ ) {
      var_31 [ var_12 ] = var_19 . get ( var_12 ) ;
    }
    return var_31 ;
  }
  