leetcode 217. Contains Duplicate
class Solution {
public boolean containsDuplicate(int[] nums) {
Set<Integer> s = new HashSet<Integer>();
for (int val: nums) {
if (!s.add(val)) return true;
}
return false;
}
}