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 73b4d9dCopy full SHA for 73b4d9d
contains-duplicate/namgiho96.ts
@@ -0,0 +1,12 @@
1
+/**
2
+ * @param {number[]} nums
3
+ * @return {boolean}
4
+ * @Description
5
+ * 1. Set을 사용하여 중복된 값을 확인한다.
6
+ * 2. Set의 크기가 nums의 길이와 다르면 중복된 값이 있다는 의미이므로 true를 반환한다.
7
+ * 3. Set의 크기가 nums의 길이와 같으면 중복된 값이 없다는 의미이므로 false를 반환한다.
8
+ */
9
+
10
+function containsDuplicate(nums: number[]): boolean {
11
+ return new Set(nums).size !== nums.length;
12
+}
0 commit comments