def findDuplicate(self, nums):
:type nums: List[int]
return (sum(nums) - sum(list(set(nums)))) / (len(nums) - len(list(set(nums))))
Yes, set(nums) needs O(n) space
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.