题目:
题解:
class Solution:
def findDuplicates(self, nums: List[int]) -> List[int]:
ans = []
for x in nums:
x = abs(x)
if nums[x - 1] > 0:
nums[x - 1] = -nums[x - 1]
else:
ans.append(x)
return ans