clear code with simple looping and tracking | 100% beats
Approach
Tracking the prefix sum and sufix sum with simple for loop and comparing prefix and sufix.
use long varible for prefix and sufix else we facing the err

# Approach
<!-- Describe your approach to solving the problem. -->
1. Tracking the prefix sum and sufix sum with simple for loop and comparing prefix and sufix.
2. use long varible for prefix and sufix else we facing the error.
3. upvote if u like my approch and explanation.
# Complexity
- Time complexity:O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

# Code
```java []
class Solution {
    public int waysToSplitArray(int[] nums) {
        int count=0;
        long sum=0;
        for(int i:nums){
            sum+=i;
        }
        long val=0;
        for(int i=0;i<nums.length-1;i++){
            val+=nums[i];
            sum-=nums[i];
            if(val>=sum) count++;
        }
        return count;
    }
}
```
['Prefix Sum', 'Java']