Given an integer array nums, determine if there exists an index i such that the sum of elements to the left of i is equal to the sum of elements to the right of i. If such an index exists, return the leftmost index. If no such index exists, return -1. Note that the element at index i itself is excluded from both the left and right summations.
Explanation: At index 3, the left sum is 1 + 7 + 3 = 11 and the right sum is 5 + 6 = 11.
Explanation: No index satisfies the condition as the left and right sums never balance.
Master coding challenges related to Arrays and solve the Equilibrium Segment Balance problem optimally.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak