Prefix Sum
Python 3\npython\nclass Solution:\n    def waysToSplitArray(self, n: List[int]) -> int:\n        n = list(accumulate(n))\n        return sum(n[i] >= n[-1] - n[i
**Python 3**\n```python\nclass Solution:\n    def waysToSplitArray(self, n: List[int]) -> int:\n        n = list(accumulate(n))\n        return sum(n[i] >= n[-1] - n[i] for i in range(len(n) - 1))\n```\n\n**C++**\nWe could use a prefix sum, but in C++ we would need to store it in another `long long` vector (because of overflow). So, we are using a running sum here for efficiency.\n```cpp\nint waysToSplitArray(vector<int>& n) {\n    long long right = accumulate(begin(n), end(n), 0LL), left = 0, res = 0;\n    for (int i = 0; i < n.size() - 1; ++i) {\n        left += n[i];\n        right -= n[i];\n        res += left >= right;\n    }\n    return res;\n}\n```
['C', 'Python3']