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 0fc7ec8 commit 19d7689Copy full SHA for 19d7689
contains-duplicate/1lsang.ts
@@ -0,0 +1,5 @@
1
+function containsDuplicate(nums: number[]): boolean {
2
+ // Javascript의 Set은 내부적으로 해시테이블을 이용해서, O(n)으로 중복 제거
3
+ const uniqueNums = Array.from(new Set(nums).values());
4
+ return uniqueNums.length !== nums.length;
5
+};
0 commit comments