Skip to content

Commit 468ecd1

Browse files
committed
feat: solve new question
0 parents  commit 468ecd1

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

contains-duplicate/main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
var containsDuplicate = function(nums) {
2+
let set = new Set()
3+
for (let i=0; i < nums.length; i++) {
4+
console.log(nums[i]);
5+
if (set.has(nums[i])) {
6+
return true;
7+
}else{
8+
set.add(nums[i]);
9+
}
10+
}
11+
console.log(set);
12+
return false;
13+
};
14+
15+
console.log(containsDuplicate([1,2,3,1]));

contains-duplicate/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bun main.js

push.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
git status
2+
git add .
3+
git commit -m "feat: solve new question"
4+
git push

0 commit comments

Comments
 (0)