Skip to content

Commit e86faa5

Browse files
committed
add solution: contains-duplicate
1 parent 12c6c5a commit e86faa5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

contains-duplicate/yihyun-kim1.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {boolean}
4+
*/
5+
6+
// Set은 중복을 자동으로 제거하므로 Set의 크기가 원래 배열 길이보다 작으면 중복이 존재한다는 것
7+
const containsDuplicate = (nums) => new Set(nums).size !== nums.length;

0 commit comments

Comments
 (0)