Skip to content

Commit ace8fba

Browse files
committed
Add week 1 solutions: contains-duplicate
1 parent ee1ad8e commit ace8fba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

contains-duplicate/gitsunmin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* https://leetcode.com/problems/contains-duplicate/
3+
* time complexity : O(n)
4+
* space complexity : O(n)
5+
*/
6+
function containsDuplicate(nums: number[]): boolean {
7+
return new Set(nums).size !== nums.length
8+
};

0 commit comments

Comments
 (0)