@@ -0,0 +1,671 @@
+%22%22%22%0A%5Bref.href%5D leetcode.com/problems/contains-duplicate-ii%0A%22%0A  Given an array of integers and an integer k, find out whether %0A  there are two distinct indices i and j in the array such that %0A  nums%5Bi%5D = nums%5Bj%5D and the difference between i and j is at most k.%0A%22%0A%22%22%22%0A%0Aclass Solution(object):%0A    def containsNearbyDuplicate(self, nums, k):%0A        %22%22%22%0A        :type nums: List%5Bint%5D%0A        :type k: int%0A        :rtype: bool%0A        %22%22%22%0A        dups = %7B%7D%0A        i = 0%0A        for n in nums:%0A            if n in dups:%0A                j = dups%5Bn%5D%0A                if i - j %3C= k:%0A                    return True%0A            dups%5Bn%5D = i%0A            i += 1%0A        return False%0A

Create containsNearbyDup.py