We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f291ae8 commit 61578ecCopy full SHA for 61578ec
contains-duplicate/lhc0506.js
@@ -0,0 +1,10 @@
1
+/**
2
+ * @param {number[]} nums
3
+ * @return {boolean}
4
+ */
5
+var containsDuplicate = function(nums) {
6
+ const numsSet = new Set();
7
+ nums.forEach(num => numsSet.add(num));
8
+
9
+ return nums.length !== numsSet.size;
10
+};
0 commit comments