Beats 100% ✨
IntuitionApproachComplexity
Time complexity:
O(n)
Space complexity:
O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
$$O(n)$$
- Space complexity:
$$O(1)$$ 

# Code
```cpp []
class Solution {
public:
    int waysToSplitArray(vector<int>& nums) {
        long long sum=0;
        for(int i=0; i<nums.size();i++){
            sum+=nums[i];
        }
        long long psum=0;
        int ans=0;
        for(int i=0; i<nums.size()-1;i++){
            psum+=nums[i];
            sum-=nums[i];
            if(psum>=sum){
                ans++;
            }
        }
        return ans;
    }
};
```
['Prefix Sum', 'C++']