Find the number repeated more than once in an array using constant space.
Implement a function that returns any value that appears at least twice in the input array. The input is a list of integers, and you should use O(1) extra space beyond the array itself. If multiple values are repeated, return any one of them.
Function signature: find_duplicate(nums)
Input: nums, a list of integers.
Output: An integer that appears more than once.
def find_duplicate(nums):