Given an array of integers, find the contiguous subarray that has the largest product and return that product.
Implement max_product_subarray(nums). The input is a non-empty list of integers, and the output is a single integer. Account for positive values, negative values, and zeros.
def max_product_subarray(nums):