标签:
public class Solution { public boolean containsDuplicate(int[] nums) { HashSet<Integer> hs = new HashSet<Integer>(); for (int i : nums) { if (hs.contains(i)) { return true; } else { hs.add(i); } } return false; } }
标签:
原文地址:http://www.cnblogs.com/77rousongpai/p/4539784.html