18 / 18 个通过测试用例
状态:通过
执行用时:10 ms
内存消耗:42.9 MB
提交时间:6 月,3 周之前
class Solution {
public boolean containsDuplicate(int[] nums) {
Set<Integer> set = new HashSet();
for (int i = 0; i < nums.length; i++) {
set.add(nums[i]);
}
return nums.length > set.size() ? true:false;
}
}