Simple C++ Solution || Prefix Sum || O(n)
if it's help, please up ⬆ vote! ❤️Complexity
Time complexity: O(n)

Space complexity: O(n)
Code
# if it's help, please up ⬆ vote! ❤️


# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(n)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int waysToSplitArray(vector<int>& nums) 
    {
        vector<long> pref;
        pref.push_back(0);
        for(auto val : nums) pref.push_back(pref.back() + val);

        int ans = 0, n = nums.size();
        for(int i = 1; i < n; i++)
            if(pref[i] >= pref.back() - pref[i]) ans++;
        return ans;    
    }
};
```
['Array', 'Hash Table', 'Math', 'Prefix Sum', 'C++']