We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53ce7c7 commit 2261b21Copy full SHA for 2261b21
contains-duplicate/jinvicky.java
@@ -0,0 +1,11 @@
1
+import java.util.*;
2
+
3
+class Solution {
4
+ public boolean containsDuplicate(int[] nums) {
5
+ Set<Integer> set = new HashSet<>();
6
+ for(int num : nums) {
7
+ if(!set.add(num)) return true;
8
+ }
9
+ return false;
10
11
+}
0 commit comments