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 eb9f6ceCopy full SHA for eb9f6ce
.gitignore
@@ -2,3 +2,4 @@
2
.vscode/
3
.DS_Store
4
.env
5
+/leetcode-study.iml
contains-duplicate/shinheekim.java
@@ -0,0 +1,15 @@
1
+import java.util.HashSet;
+import java.util.Set;
+
+class Solution {
+ public boolean containsDuplicate(int[] nums) {
6
+ Set<Integer> visited = new HashSet<>();
7
8
+ for (int n : nums){
9
+ if (!visited.add(n)){
10
+ return true;
11
+ }
12
13
+ return false; // 모든 값이 고유할 때
14
15
+}
0 commit comments