Skip to content

Commit bf55a8a

Browse files
committed
contains-duplicate
1 parent f291ae8 commit bf55a8a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contains-duplicate/JANGSEYEONG.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {boolean}
4+
*/
5+
var containsDuplicate = function (nums) {
6+
// Set으로 만들었을 때, 기존 배열과 사이즈가 다르면 중복이 제거된거임
7+
const numsSet = new Set(nums);
8+
return nums.length !== numsSet.size;
9+
};

0 commit comments

Comments
 (0)