Easy approach ✅✅✅ || Prefix Sum || Simple Explanation 💯 💯
IntuitionThe Problem aims to count the number of "valid split points" in an array nums, where the prefix sum of the left subarray (from index 0 to i) is greater
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
The Problem aims to count the number of **"valid split points"** in an array nums, where the prefix sum of the left subarray (from index 0 to i) is greater than or equal to the sum of the right subarray (from index i+1 to the end of the array).
A valid split point satisfies the condition:
- Prefix sum of left subarray >= prefix sum of right subarray 
- ` pre[i] >= total-pre[i]`
# Approach
<!-- Describe your approach to solving the problem. -->
- Calculate the Total Sum and Prefix Sum Array
- Count Valid Split Points
- Return the Count

# 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
```java []
class Solution {
    public int waysToSplitArray(int[] nums) {
        int n=nums.length;
        long[] pre=new long[n];
        long sum=0;
        long total=0;
        for(int i=0;i<n;i++){
            total+=nums[i];
            sum+=nums[i];
            pre[i]=sum;
        }
        int res=0;
        for(int i=0;i<n-1;i++){
            if(pre[i]>=total-pre[i]){
                res++;
            }
        }
        return res;
    }
}
```
['Java']