Skip to content

Commit b1728a9

Browse files
committed
contains duplicate solution
1 parent 6d6a640 commit b1728a9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contains-duplicate/prgmr99.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {boolean}
4+
*/
5+
var containsDuplicate = function (nums) {
6+
const numArrLength = nums.length;
7+
const numSetSize = new Set(nums).size;
8+
9+
return numArrLength !== numSetSize;
10+
};

0 commit comments

Comments
 (0)