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 03140c1Copy full SHA for 03140c1
contains-duplicate/byol-han.js
@@ -0,0 +1,9 @@
1
+// Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
2
+/**
3
+ * @param {number[]} nums
4
+ * @return {boolean}
5
+ */
6
+var containsDuplicate = function (nums) {
7
+ const uniqueSet = new Set(nums);
8
+ return uniqueSet.size !== nums.length;
9
+};
0 commit comments