Find Duplicate number in array
Given an array nums containing n + 1 integers where each value is in the range 1 through n, exactly one value is duplicated, possibly more than once. Return the duplicated value.
Implement find_duplicate(nums), returning an integer. Prefer an approach using O(1) extra space and without modifying the input array.
def find_duplicate(nums):