Skip to content

Commit f3c53d5

Browse files
authored
Create 448-Find-all-Numbers-Disappeared-in-an-Array.py
1 parent 80c913c commit f3c53d5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)