Skip to content

Commit 2c7db9e

Browse files
committed
[:solved] #235
1 parent 8f248e1 commit 2c7db9e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

missing-number/ppxyn1.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)