def findDuplicate(self, nums):
for i in nums:
if result&(1<<i):return i
is that really using O(1) space?
from your answer ,i think u use a bit to indicate a num from nums,
but a byte only have 8bits so you may need o(n/32) = o(n) space??
yes, in python, a int is very very big. But you are right, it is O(n)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.