Add size to every element of nums[nums[i]] for i in range(size) This will make every number(appeared in array)'s corresponding index > size
Traverse array, find value <= size. Then the index is the answer element.
Last updated 4 years ago