@@ -0,0 +1,777 @@
+package LeetCode.Java;%0A%0A/**%0A * Created by Vonzpf on 17/4/4.%0A */%0A%0Aimport java.util.HashMap;%0A%0A/**-------------------------Title---------------------------------%0A Given an array of integers, find if the array contains any duplicates.%0A Your function should return true if any value appears at least twice in the array,%0A and it should return false if every element is distinct.%0A */%0Apublic class ContainsDuplicate %7B%0A    public boolean containsDuplicate(int%5B%5D nums) %7B%0A        HashMap%3CInteger, Integer%3E map = new HashMap%3CInteger, Integer%3E();%0A        for (int i = 0; i %3C nums.length; i++)%7B%0A            if (!map.containsKey(nums%5Bi%5D))%7B%0A                map.put(nums%5Bi%5D, 1);%0A            %7D%0A            else%7B%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

217.Contains Duplicate