@@ -0,0 +1,662 @@
+/**%0A * Given an array of integers and an integer k, find out whether there are two distinct indices i and j %0A * in the array such that nums%5Bi%5D = nums%5Bj%5D and the difference between i and j is at most k.%0A */%0Apublic class Solution %7B%0A    public boolean containsNearbyDuplicate(int%5B%5D nums, int k) %7B%0A        if(nums == null %7C%7C nums.length == 0 %7C%7C k %3C= 0) return false;%0A        Map%3CInteger, Integer%3E map = new HashMap%3CInteger, Integer%3E();%0A        for(int i = 0; i %3C nums.length; i++) %7B%0A            int n = nums%5Bi%5D;%0A            if(map.containsKey(n) && i - map.get(n) %3C= k)%0A                return true;%0A            map.put(n, i);%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

Create 219.java