Simple Approach with Efficient time and space complexity :-
IntuitionThe problem involves splitting an array such that the left sum is greater than or equal to the right sum.
By precomputing the total sum (rSum) and dyna
# Intuition
The problem involves splitting an array such that the left sum is greater than or equal to the right sum.
By precomputing the total sum (rSum) and dynamically adjusting it during iteration, we avoid recomputation, making the solution efficient.
## At every step, the split condition 
lSum≥rSum ensures only valid splits are counted.

# Approach
1. Calculate Total Sum (Right Sum):
Compute the total sum of the array nums, which will serve as the   initial right sum (rSum).

2.Iterate Through the Array:
For each element (except the last one):
  Add the current element to the left sum (lSum).
  Subtract the current element from the right sum (rSum).
  Check if lSum >= rSum. If true, increment the count.

3.Return Count:
After iterating, the final count represents the number of valid splits

# Complexity
- Time complexity: O(n) + O(n) = O(n)

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

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