```
class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
dups = [0] * (len(nums))
for n in nums:
dups[n] += 1
for d in range(len(dups)):
if dups[d] > 1:
return d
```