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 8f248e1 commit 2c7db9eCopy full SHA for 2c7db9e
1 file changed
missing-number/ppxyn1.py
@@ -0,0 +1,12 @@
1
+# idea : -
2
+# Time Complexity : below O(n^2)
3
+
4
+class Solution:
5
+ def missingNumber(self, nums: List[int]) -> int:
6
+ nums.sort()
7
+ for i in range(len(nums)):
8
+ if nums[i] != i:
9
+ return i
10
+ return len(nums)
11
12
0 commit comments