@@ -0,0 +1,833 @@
+import java.util.HashMap;%0A%0Apublic class ContainsDuplicates %7B%0A    public boolean containsDuplicate(int%5B%5D nums) %7B%0A        HashMap%3CInteger, Integer%3E occurrenceCountMap = new HashMap%3C%3E();%0A        for (int num : nums) %7B%0A            if (occurrenceCountMap.containsKey (num)) %0A                return true;%0A            else %0A                occurrenceCountMap.put (num, 1);%0A        %7D%0A        return false;%0A    %7D%0A    %0A    public static void main (String%5B%5D args) %7B%0A        ContainsDuplicates test = new ContainsDuplicates ();%0A        int%5B%5D testArray1 = %7B1, 2, 3, 4, 5%7D;%0A        int%5B%5D testArray2 = %7B1, 1, 455%7D;%0A        int%5B%5D testArray3 = %7B%7D;%0A        System.out.println(test.containsDuplicate (testArray1));%0A        System.out.println(test.containsDuplicate (testArray2));%0A        System.out.println(test.containsDuplicate (testArray3));%0A    %7D%0A%7D

Check if array has duplicate values