class Solution:
def maxProduct(self, nums: List[int]) -> int:
= max_so_far = min_so_far = nums[0]
max_product
for curr_num in nums[1:]:
= [curr_num, max_so_far * curr_num, min_so_far * curr_num]
choices = min(choices)
min_so_far = max(choices)
max_so_far
= max(max_product, max_so_far)
max_product
return max_product