comefrom: <awangdev>219. Contains Duplicate II_2.java
code: public boolean containsNearbyDuplicate(int[] nums, int k) {
          if (nums == null || nums.length == 0 || k <= 0) {
              return false;
          }
          Map<Integer, List<Integer>> map = new HashMap<>();
          for (int i = 0; i < nums.length; i++) {
              if (map.containsKey(nums[i])) {
                  for (int index : map.get(nums[i])) { 
                      if (Math.abs(index - i) <= k) {
                          return true;
                      }
                  }
              } else {
                  map.put(nums[i], new ArrayList<>());
              }
              map.get(nums[i]).add(i);
          }
          return false;
      }
masked: public boolean var_0 ( int [ ] var_1 , int var_2 ) {
    if ( var_1 == null || var_1 . length == 0 || var_2 <= 0 ) {
      return false ;
    }
    Map < Integer , List < Integer >> var_3 = new HashMap < > ( ) ;
    for ( int var_4 = 0 ;
    var_4 < var_1 . length ;
    var_4 ++ ) {
      if ( var_3 . containsKey ( var_1 [ var_4 ] ) ) {
        for ( int var_5 : var_3 . get ( var_1 [ var_4 ] ) ) {
          if ( Math . abs ( var_5 - var_4 ) <= var_2 ) {
            return true ;
          }
        }
      }
      else {
        var_3 . put ( var_1 [ var_4 ] , new ArrayList < > ( ) ) ;
      }
      var_3 . get ( var_1 [ var_4 ] ) . add ( var_4 ) ;
    }
    return false ;
  }
  