@@ -0,0 +1,953 @@
+/**%0A * Given an array of integers, find out whether there are two distinct indices i and j in the array %0A * such that the difference between nums%5Bi%5D and nums%5Bj%5D is at most t and the difference between i %0A * and j is at most k.%0A */%0A%0Apublic class Solution %7B%0A    public boolean containsNearbyAlmostDuplicate(int%5B%5D nums, int k, int t) %7B%0A        if(nums == null %7C%7C nums.length == 0 %7C%7C k %3C= 0 %7C%7C t %3C 0) %0A            return false;%0A        TreeSet%3CInteger%3E pool = new TreeSet%3CInteger%3E();%0A        for(int i = 0; i %3C nums.length; i++)%7B%0A            int n = nums%5Bi%5D;%0A            if((pool.ceiling(n) != null &&  n %3E= pool.ceiling(n) - t) %7C%7C %0A            (pool.floor(n) != null && n %3C= pool.floor(n) + t)) // take care of overflow!!!%0A                return true;%0A            else%0A                pool.add(n);%0A            //maintain a sliding window with size %3C= k%0A            if(i %3E= k)%0A                pool.remove(nums%5Bi-k%5D);%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

Create 220.java