<awangdev>Contains Duplicate III_1.java
public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
        if (nums == null || nums.length == 0 || k <= 0 || t < 0) {
            return false;
        }
        TreeSet<Long> treeSet = new TreeSet<>();
        for (int i = 0; i < nums.length; i++) {
            Long target = treeSet.ceiling((long)nums[i] - t);
            if (target != null && target <= (long)nums[i] + t) {
                return true;
            }
            if (i >= k) {
                treeSet.remove((long)nums[i - k]);
            }
            treeSet.add((long)nums[i]);
        }
        return false;
    }
public boolean var_0 ( int [ ] var_1 , int var_2 , int var_3 ) {
  if ( var_1 == null || var_1 . length == 0 || var_2 <= 0 || var_3 < 0 ) {
    return false ;
  }
  TreeSet < Long > var_9 = new TreeSet < > ( ) ;
  for ( int var_10 = 0 ;
  var_10 < var_1 . length ;
  var_10 ++ ) {
    Long var_12 = var_9 . ceiling ( ( long ) var_1 [ var_10 ] - var_3 ) ;
    if ( var_12 != null && var_12 <= ( long ) var_1 [ var_10 ] + var_3 ) {
      return true ;
    }
    if ( var_10 >= var_2 ) {
      var_9 . remove ( ( long ) var_1 [ var_10 - var_2 ] ) ;
    }
    var_9 . add ( ( long ) var_1 [ var_10 ] ) ;
  }
  return false ;
}
