Skip to content

Commit 75c7e08

Browse files
committed
Time: 15 ms (48.47%), Space: 70.4 MB (39.55%) - LeetHub
1 parent d4364da commit 75c7e08

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution {
2+
public boolean containsDuplicate(int[] nums) {
3+
Set<Integer> set = new HashSet<>(nums.length);
4+
for(int num : nums){
5+
if(set.contains(num)){
6+
return true;
7+
}
8+
set.add(num);
9+
}
10+
return false;
11+
12+
}
13+
}

0 commit comments

Comments
 (0)