Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Could we go from left to right and check to see if an index is a middle index?
Do we need to sum every number to the left and right of an index each time?
Use a prefix sum array where prefix[i] = nums[0] + nums[1] + ... + nums[i].