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 f9dc342 commit 7fe96f4Copy full SHA for 7fe96f4
contains-duplicate/suhacs.js
@@ -0,0 +1,9 @@
1
+function containsDuplicate(nums) {
2
+ const setLength = [...new Set(nums)].length;
3
+ const numLength = nums.length;
4
+
5
+ if (numLength === setLength) return false;
6
+ else return true;
7
+}
8
9
+console.log(containsDuplicate([1, 1, 1, 3, 3, 4, 3, 2, 4, 2]));
0 commit comments