Count indices where left prefix sum >= right suffix sum.

Input: nums=[10,4,-8,7] → Output: 2 Input: nums=[2,3,1,0] → Output: 2

Compute total sum. Scan left accumulating prefix; check if prefix >= total-prefix.

public int waysToSplitArray(int[] nums) { long total = 0, prefix = 0; for (int n : nums) total += n; int count = 0; for (int i = 0; i < nums.length - 1; i++) { prefix += nums[i]; if (prefix >= total - prefix) count++; } return count; }