code: def max_product(nums):
      
      lmin = lmax = gmax = nums[0]
      for i in range(len(nums)):
          t1 = nums[i] * lmax
          t2 = nums[i] * lmin
          lmax = max(max(t1, t2), nums[i])
          lmin = min(min(t1, t2), nums[i])
          gmax = max(gmax, lmax)
docs: :type nums: List[int]
      :rtype: int