2 ms🚀|| 100% Beats ✅ || JAVA || Simple Logic🌟
IntuitionApproachComplexity
Time complexity:  O(n + (n-1))

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
![Screenshot 2025-01-03 105305.png](https://assets.leetcode.com/users/images/23762585-f229-4f15-a0d2-ade060680b41_1735881825.258632.png)

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:  O(n + (n-1))
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

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

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