JAVA CODE
ApproachUsing cummulativeSum array/Prefix Sum ArrayComplexity
Time complexity: O(N)

Space complexity: O(1)
Code


# Approach 
<!-- Describe your approach to solving the problem. -->
Using cummulativeSum array/Prefix Sum Array

# 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 n = nums.length;

        // Calculate the total sum of the array
        long sum = 0;
        for (int num : nums) {
            sum += num;
        }

        long leftSum = 0;
        long rightSum = 0;
        int split = 0;

        // Iterate through the array to calculate leftSum and rightSum
        for (int i = 0; i < n - 1; i++) {
            leftSum += nums[i];
            rightSum = sum - leftSum;

            if (leftSum >= rightSum) {
                split++;
            }
        }

        return split;
    }
}
```
['Java']