Python3 !!
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:187 ms\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:77.30 mb\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunction findMaximumLength(nums: number[]): number {\n    const n = nums.length;\n    const f: number[] = Array(n + 1).fill(0);\n    const pre: number[] = Array(n + 2).fill(0);\n    const s: number[] = Array(n + 1).fill(0);\n    for (let i = 1; i <= n; ++i) {\n        s[i] = s[i - 1] + nums[i - 1];\n    }\n    const search = (nums: number[], x: number): number => {\n        let [l, r] = [0, nums.length];\n        while (l < r) {\n            const mid = (l + r) >> 1;\n            if (nums[mid] >= x) {\n                r = mid;\n            } else {\n                l = mid + 1;\n            }\n        }\n        return l;\n    };\n    for (let i = 1; i <= n; ++i) {\n        pre[i] = Math.max(pre[i], pre[i - 1]);\n        f[i] = f[pre[i]] + 1;\n        const j = search(s, s[i] * 2 - s[pre[i]]);\n        pre[j] = i;\n    }\n    return f[n];\n}\n```
['TypeScript']