[Python3] Just Code | O(n)
python3 []\nclass Solution:\n    def findMaximumLength(self, nums: List[int]) -> int:\n        n, acc, total = 0,0,0\n        dq = deque() \n        for v in nu
```python3 []\nclass Solution:\n    def findMaximumLength(self, nums: List[int]) -> int:\n        n, acc, total = 0,0,0\n        dq = deque() \n        for v in nums:\n            total+=v\n            while dq and dq[0][2]<=total: n,acc,_ = dq.popleft()\n            while dq and dq[-1][2]>=2*total-acc: dq.pop()\n            dq.append((n+1, total, 2*total-acc))\n        return n+1\n```
['Python3']