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 b34981c commit 5821b74Copy full SHA for 5821b74
contains-duplicate/devyejin.py
@@ -1,4 +1,9 @@
1
-class Solution(object):
2
- def containsDuplicate(self, nums):
3
- return len(nums) != len(set(nums))
+from typing import List
+"""
+time complexity : O(n)
4
+space complexity : O(n)
5
6
+class Solution:
7
+ def containsDuplicate(self, nums: List[int]) -> bool:
8
+ return len(set(nums)) == len(nums)
9
0 commit comments