Approach hintTry it first, then revealHide
Compute the total once, then scan while maintaining the sum to the left of i; the right sum is total - left - nums[i], so each index is checked in O(1).
Compute the total once, then scan while maintaining the sum to the left of i; the right sum is total - left - nums[i], so each index is checked in O(1).