Python Simple Solution
\nclass Solution(object):\n    def getMaxLen(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        res = 0\n      
```\nclass Solution(object):\n    def getMaxLen(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        res = 0\n        pos, neg = 0, 0\n        for num in nums:\n            if num > 0:\n                pos += 1 \n                neg = neg + 1 if neg else 0 \n            elif num < 0:\n                pos, neg = neg + 1 if neg else 0, pos + 1\n            else: pos, neg = 0, 0\n            res = max(res, pos)\n        return res\n```
[]