We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80c913c commit f3c53d5Copy full SHA for f3c53d5
448-Find-all-Numbers-Disappeared-in-an-Array.py
@@ -0,0 +1,11 @@
1
+class Solution:
2
+ def findDisappearedNumbers(self, nums: List[int]) -> List[int]:
3
+ for n in nums:
4
+ i = abs(n) - 1
5
+ nums[i] = -1 * abs(nums[i])
6
+
7
+ res = []
8
+ for i, n in enumerate(nums):
9
+ if n > 0:
10
+ res.append(i + 1)
11
+ return res
0 commit comments