Given an array of integers, find the contiguous subarray that has the largest product and return the product.
Implement max_product_subarray(nums), which accepts a non-empty list of integers and returns an integer. The subarray must contain at least one element. Account for positive values, negative values, and zeroes.
def max_product_subarray(nums):