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 1affa63 commit a5a0744Copy full SHA for a5a0744
1 file changed
contains-duplicate/gcount85.py
@@ -0,0 +1,9 @@
1
+# Approach : De-duplicate using Set
2
+# Complexity: O(n)
3
+# Space complexity: O(n)
4
+
5
6
+class Solution:
7
+ def containsDuplicate(self, nums: List[int]) -> bool:
8
+ dedup = set(nums)
9
+ return len(dedup) != len(nums)
0 commit comments