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 53ce7c7 commit c2f53f1Copy full SHA for c2f53f1
contains-duplicate/gguussuu.js
@@ -0,0 +1,9 @@
1
+/**
2
+ * @param {number[]} nums
3
+ * @return {boolean}
4
+ */
5
+var containsDuplicate = function(nums) {
6
+ //Set은 중복된 값을 허용하지 않기 때문에, 배열을 Set으로 변환한 후 길이를 비교하여 중복 여부를 확인
7
+ const hasDuplicate = new Set(nums).size !== nums.length;
8
+ return hasDuplicate;
9
+};
0 commit comments