6 lines logic || very simple
Code
# Code
```cpp []
class Solution {
public:
    int waysToSplitArray(vector<int>& nums) {
        int ans=0;
        long long total_sum=accumulate(nums.begin(),nums.end(),0L),last_sum=0;
        for(int i=0;i<nums.size()-1;i++){
            total_sum-=nums[i];
            last_sum+=nums[i];
            if(total_sum<=last_sum) ans++;
        }
        // cout<<total_sum;
        return ans;
    }
};
```
['Array', 'Prefix Sum', 'C++']