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 3c0af16 commit 986a34aCopy full SHA for 986a34a
contains-duplicate/0-chan.ts
@@ -0,0 +1,8 @@
1
+/**
2
+ * time complexity : O(n)
3
+ * space complexity : O(n)
4
+ */
5
+function containsDuplicate(nums: number[]): boolean {
6
+ const hasDuplicate = new Set(nums).size !== nums.length;
7
+ return hasDuplicate;
8
+};
0 commit comments