Simple py,JAVA code expalined!! Prefixsum || arrays !!
Approach:Prefix sumIntuition
read the question twice and understand what they are asking!

Since we need to find the sum of all the previous prefixes and sum of

# Approach:Prefix sum
<!-- Describe your approach to solving the problem. -->
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
> read the question twice and understand what they are asking!
- Since we need to find the sum of all the previous *prefixes* and sum of all values for *suffixes* for the interval **0 to n-1** we will use `prefixSum` and `suffixSum` array to calulate those sums.
- Then we check for `prefixSum[i]>=suffixSum[i]` where `i` is the is the split interval.
- `count` is used to track the valid split.

# 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
```python3 []
class Solution:
    def waysToSplitArray(self, nums: List[int]) -> int:
        prefixSum=[0]*len(nums)
        suffixSum=[0]*len(nums)
        prefix=suffix=0
        for i in range(len(nums)):
            prefix+=nums[i]
            prefixSum[i]=prefix
        for i in range(len(nums)-1,-1,-1):
            suffix+=nums[i]
            suffixSum[i]=suffix
        #print(prefixSum,suffixSum)
        count=0
        for i in range(len(nums)-1):
            if prefixSum[i]>=suffixSum[i+1]:
                count+=1
        return count
```
```JAVA []
class Solution {
    public int waysToSplitArray(int[] nums) {
        int l=nums.length;
        long[] prefixSum=new long[l];
        long[] suffixSum=new long[l];
        long prefix=0,suffix=0;
        for(int i=0;i<l;i++){
            prefix+=nums[i];
            prefixSum[i]=prefix;
        }
        for(int i=l-1;i>-1;i--){
            suffix+=nums[i];
            suffixSum[i]=suffix;
        }
        int count=0;
        for(int i=0;i<l-1;i++){
            if(prefixSum[i]>=suffixSum[i+1]){
                count++;
            }
        }
        return count;
    }
}
````
['Array', 'Prefix Sum', 'Java', 'Python3']