class Solution:

    def maxProduct(self, nums):
        A = nums[::-1]
        for i in range(1, len(A)):
            nums[i] *= nums[i - 1] or 1
            A[i] *= A[i - 1] or 1
        return max(nums + A)

c2c587dec3174a3ce28112bdd548b52fd68e2ca2
<mask token>

class Solution:
    <mask token>

class Solution:

    def maxProduct(self, nums):
        A = nums[::-1]
        for i in range(1, len(A)):
            nums[i] *= nums[i - 1] or 1
            A[i] *= A[i - 1] or 1
        return max(nums + A)
