标签:href ica 元素 ret leetcode set hashset java com
Java
class Solution {
public boolean containsDuplicate(int[] nums) {
Set<Integer> s = new HashSet<>();
for(int i = 0 ; i<nums.length ; i++){
if(s.contains(nums[i])){
return true;
}
s.add(nums[i]);
}
return false;
}
}
标签:href ica 元素 ret leetcode set hashset java com
原文地址:https://www.cnblogs.com/xkf97/p/13155320.html