def maxProduct_error2(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        if len(nums) < 2:
            return max(nums)

        n = len(nums)
        F_pos = [0 for _ in xrange(n+1)]
        F_neg = [0 for _ in xrange(n+1)]

        maxa = 1
        for i in xrange(1, n+1):
            v = nums[i-1]
            if v > 0:
                F_pos[i] = F_pos[i-1]*v if F_pos[i-1] != 0 else v
                F_neg[i] = F_neg[i-1]*v
            elif v == 0:
                F_pos[i], F_neg[i] = 0, 0
            else:
                F_neg[i] = min(0, F_pos[i-1]*v)
                F_pos[i] = max(0, F_neg[1-i]*v)

            maxa = max(maxa, F_pos[i])

        return maxa
dataset/ETHPy150Open algorhythms/LeetCode/152 Maximum Product Subarray.py/Solution.maxProduct_error2/swapped operands of `-`