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 0fc7ec8 commit 9d9d3b9Copy full SHA for 9d9d3b9
contains-duplicate/hozzijeong.js
@@ -0,0 +1,10 @@
1
+/**
2
+ * @param {number[]} nums
3
+ * @return {boolean}
4
+ */
5
+var containsDuplicate = function(nums) {
6
+ const originLength = nums.length;
7
+ const numsSet = new Set(nums);
8
+
9
+ return originLength !== numsSet.size;
10
+};
0 commit comments