```
class Solution(object):
def findDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
freq = [0]*(len(nums)+1)
for i in nums:
freq[i] += 1
return [i for i,v in enumerate(freq) if v == 2]
```