Given an array of integers, write an algorithm to find the peak element where the element is greater than its neighbors.
Return the index of any valid peak element. Treat an array boundary as having only its existing neighbor, assume adjacent values are distinct, and guarantee that the input is non-empty.
Implement def find_peak(nums):, where nums is a list of integers and the return value is an integer index.
def find_peak(nums):