Python Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def findMaximumLength(self, nums: List[int]) -> int:\n        n = len(nums)\n        s = list(accumulate(nums, initial=0))\n        f = [0] * (n + 1)\n        pre = [0] * (n + 2)\n        for i in range(1, n + 1):\n            pre[i] = max(pre[i], pre[i - 1])\n            f[i] = f[pre[i]] + 1\n            j = bisect_left(s, s[i] * 2 - s[pre[i]])\n            pre[j] = i\n        return f[n]\n```
['Python3']