Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

class Solution(object): def findDuplicate(self, nums): """ :type nums: List[int] :rtype: int """ for i in xrange(len(nums)): if nums[abs(nums[i])] >= 0: nums[abs(nums[i])] = -nums[abs(nums[i])] else: return abs(nums[i])

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.