public class Solution {
public boolean containsDuplicate(int[] nums) {
if(nums.length==0) return false;
HashSet<Integer> h=new HashSet<Integer>();
for(int i:nums)
if( h.add(i)==false) return true;
return false;
}
}
leetcode:Contains Duplicate
最新推荐文章于 2017-05-14 20:15:42 发布