```
class Solution(object):
def findDuplicate(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
# for i in range(len(nums)):
# if nums[i] in nums[i+1:]:
# return nums[i]
nums_uniq = list(set(nums))
occurrence = len(nums) - len(nums_uniq)
return int((sum(nums) - sum(nums_uniq)) / occurrence)
```