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 90fec72Copy full SHA for 90fec72
contains-duplicate/solbijae.ts
@@ -0,0 +1,11 @@
1
+function containsDuplicate(nums: number[]): boolean {
2
+ const set = new Set(nums);
3
+ const setSize = set.size;
4
+ const numsLength = nums.length;
5
+
6
+ return setSize !== numsLength ? true : false;
7
8
+ // Big O
9
+ // 시간 복잡도: O(n) 한번씩 순회하면서 확인
10
+ // 공간 복잡도: O(n) Set을 사용해 배열 크기만큼 메모리가 더 사용됨
11
+};
0 commit comments