Simple Java Solution with O(n) tc | Beats 100%.
IntuitionApproachTo solve this problem, first calculate the total sum of the array. Then, iterate through the array while keeping a running sum for the left par
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
To solve this problem, first calculate the total sum of the array. Then, iterate through the array while keeping a running sum for the left part (leftsum). At each step, check if leftsum is greater than or equal to the remaining right part (sum - leftsum). If true, increment the count. Finally, return the count.
<!-- Describe your approach to solving the problem. -->

# 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;
        long leftsum=0;
        for(int n:nums){
            sum+=n;
        }
        for(int i=0;i<nums.length-1;++i){
            leftsum+=nums[i];
            if(leftsum>=sum-leftsum) count++;
            
        }
        return count;
    }
}
```
['Prefix Sum', 'Java']