[Python] Easy python dp solution
python\nclass Solution:\n    def getMaxLen(self, nums: List[int]) -> int:\n        pos, neg = 0, 0\n        res = 0\n        for n in nums:\n            if n==0
```python\nclass Solution:\n    def getMaxLen(self, nums: List[int]) -> int:\n        pos, neg = 0, 0\n        res = 0\n        for n in nums:\n            if n==0:\n                neg, pos = 0, 0\n            elif n>0:\n                if neg>0: neg, pos = neg+1, pos+1\n                else: neg, pos = 0, pos+1\n            else:\n                if neg>0: pos, neg = neg+1, pos+1\n                else: neg, pos = pos+1, 0\n            res = max(res,pos)\n        return res\n```
[]