Count the split points where the left part has a sum at least as large as the right part.
Given an integer array nums, count how many indices i can be chosen so that splitting the array into nums[0..i] and nums[i+1..n-1] produces a left sum that is greater than or equal to the right sum.
A split is valid only when both parts are non-empty.
nums.Return the number of valid split indices.
Example 1
Input
nums = [10, 4, -8, 7]
Output
2
Explanation
Valid splits are after index 0 and after index 1.
Example 2
Input
nums = [2, 3, 1, 0]
Output
2
Explanation
Valid splits are after index 1 and after index 2.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.