def max_product(nums):
lmin = lmax = gmax = nums[<NUM_LIT:0>]<EOL>for i in range(len(nums)):<EOL><INDENT>t1 = nums[i] * lmax<EOL>t2 = nums[i] * lmin<EOL>lmax = max(max(t1, t2), nums[i])<EOL>lmin = min(min(t1, t2), nums[i])<EOL>gmax = max(gmax, lmax)<EOL><DEDENT>
:type nums: List[int]
:rtype: int