comefrom: <gouthampradhan>greedy_BoatsToSavePeople_1.java
code: public int numRescueBoats(int[] people, int limit) {
      TreeMap<Integer, Integer> treeMap = new TreeMap<>();
      int boats = 0;
      for (int p : people) {
        treeMap.putIfAbsent(p, 0);
        treeMap.put(p, treeMap.get(p) + 1);
      }
      Arrays.sort(people);
      for (int p : people) {
        if (treeMap.containsKey(p)) {
          int count = treeMap.remove(p);
          --count;
          if (count != 0) {
            treeMap.put(p, count);
          }
          int balance = limit - p;
          Map.Entry<Integer, Integer> floor = treeMap.floorEntry(balance);
          if (floor != null) {
            int c = floor.getValue();
            --c;
            treeMap.remove(floor.getKey());
            if (c != 0) {
              treeMap.put(floor.getKey(), c);
            }
          }
          boats++;
        }
      }
      return boats;
    }
masked: public int sample_funcname ( int [ ] var_0 , int var_1 ) {
    TreeMap < Integer , Integer > var_2 = new TreeMap < > ( ) ;
    int var_3 = 0 ;
    for ( int var_4 : var_0 ) {
      var_2 . putIfAbsent ( var_4 , 0 ) ;
      var_2 . put ( var_4 , var_2 . get ( var_4 ) + 1 ) ;
    }
    Arrays . sort ( var_0 ) ;
    for ( int var_4 : var_0 ) {
      if ( var_2 . containsKey ( var_4 ) ) {
        int var_5 = var_2 . remove ( var_4 ) ;
        -- var_5 ;
        if ( var_5 != 0 ) {
          var_2 . put ( var_4 , var_5 ) ;
        }
        int var_6 = var_1 - var_4 ;
        Map . Entry < Integer , Integer > var_7 = var_2 . floorEntry ( var_6 ) ;
        if ( var_7 != null ) {
          int var_8 = var_7 . getValue ( ) ;
          -- var_8 ;
          var_2 . remove ( var_7 . getKey ( ) ) ;
          if ( var_8 != 0 ) {
            var_2 . put ( var_7 . getKey ( ) , var_8 ) ;
          }
        }
        var_3 ++ ;
      }
    }
    return var_3 ;
  }
  