class Solution:
def maxProduct(self, nums: List[int]) -> int:
#SC: O(len(nums))
#SC: O(1)
res = nums[0]
currMax = nums[0]
currMin = nums[0]
for i in range(1, len(nums)):
Max = max(max(currMax*nums[i], currMin*nums[i]), nums[i])
Min = min(min(currMax*nums[i], currMin*nums[i]), nums[i])
res = max(Max, res)
currMax = Max
currMin = Min
return res