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 bf55a8aCopy full SHA for bf55a8a
contains-duplicate/JANGSEYEONG.js
@@ -0,0 +1,9 @@
1
+/**
2
+ * @param {number[]} nums
3
+ * @return {boolean}
4
+ */
5
+var containsDuplicate = function (nums) {
6
+ // Set으로 만들었을 때, 기존 배열과 사이즈가 다르면 중복이 제거된거임
7
+ const numsSet = new Set(nums);
8
+ return nums.length !== numsSet.size;
9
+};
0 commit comments