@Test public void bigInput() throws Exception { int[] ints = readBigArrayOfInts("bigInput217.properties", "bigArray"); Solution solution = new Solution(); boolean dups = solution.containsDuplicate(ints); assertThat(dups, is(false)); }
public boolean containsDuplicate(int[] nums) { if (nums == null || nums.length == 0) { return false; } else { Set<Integer> ints = new HashSet<>(); for (int num : nums) { if (ints.contains(num)) { return true; } ints.add(num); } } return false; }
Solution { public boolean containsDuplicate(int[] nums) { if (nums == null || nums.length == 0) { return false; } else { Set<Integer> ints = new HashSet<>(); for (int num : nums) { if (ints.contains(num)) { return true; } ints.add(num); } } return false; } }
Solution { public boolean containsDuplicate(int[] nums) { if (nums == null || nums.length == 0) { return false; } else { Set<Integer> ints = new HashSet<>(); for (int num : nums) { if (ints.contains(num)) { return true; } ints.add(num); } } return false; }  }
Solution { public boolean containsDuplicate(int[] nums) { if (nums == null || nums.length == 0) { return false; } else { Set<Integer> ints = new HashSet<>(); for (int num : nums) { if (ints.contains(num)) { return true; } ints.add(num); } } return false; }  boolean containsDuplicate(int[] nums); }
Solution { public boolean containsDuplicate(int[] nums) { if (nums == null || nums.length == 0) { return false; } else { Set<Integer> ints = new HashSet<>(); for (int num : nums) { if (ints.contains(num)) { return true; } ints.add(num); } } return false; }  boolean containsDuplicate(int[] nums);  }