Skip to content

Commit 9a87311

Browse files
author
diego.junges.ter
committed
feat: added 217-Contains-Duplicate solution
1 parent 93232c6 commit 9a87311

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+
containsDuplicate(nums) {
3+
const hashmap = new Set()
4+
for (let num of nums) {
5+
if (hashmap.has(num)) {
6+
return true
7+
} else {
8+
hashmap.add(num)
9+
}
10+
}
11+
return false
12+
};
13+
}

0 commit comments

Comments
 (0)