class Solution:
    def get_maximum_product(self, nums):
        max_so_far = float('-inf')
        max_here, min_here = 1, 1
        for num in nums:
            max_here, min_here = max(max_here * num, min_here * num, num), min(min_here * num, max_here * num, num)
            max_so_far = max(max_so_far, max_here)
        return max_so_far

solution = Solution()
nums = [2, 3, -2, -4]
print(solution.get_maximum_product(nums))
