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 da7971f commit 906e832Copy full SHA for 906e832
contains-duplicate/codyman0.py
@@ -0,0 +1,15 @@
1
+"""
2
+https://leetcode.com/problems/contains-duplicate/
3
4
+
5
+# Time complexity : O(n)
6
7
+class Solution:
8
+ def containsDuplicate(self, nums: List[int]) -> bool:
9
+ sortedArrary = sorted(nums)
10
+ for i in range(len(sortedArrary)):
11
+ if i == len(sortedArrary) - 1:
12
+ return False
13
+ if sortedArrary[i] == sortedArrary[i + 1] :
14
+ return True
15
0 commit comments