Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

Given an array of positive integers, find an index where the array can be split into two contiguous subarrays with equal sums. The element at the split index belongs to the left subarray, while the element immediately after starts the right subarray. If no valid split exists, return -1.

Test Cases
Input
Output
Expected