Given an array, return the pair with maximum product, handling negative values, in O(n). Asked in the Round 2 stage.
Implement maximum_product_pair(nums). The input is an integer array with at least two elements. Return a two-element list containing the values whose product is maximal. If multiple pairs produce the same maximum product, return any one valid pair.
Constraints: 2 <= len(nums) <= 10^4, and -10^9 <= nums[i] <= 10^9.
def maximum_product_pair(nums):