Search
⌘K

Leetcode 1991. Find the Middle Index in Array

Find the leftmost index in an integer array where the sum of elements to its left equals the sum of elements to its right, returning -1 if none exists. This "pivot" can be found efficiently by comparing a running left sum with the total sum.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.