The problem here gave us non-negative restriction, so we can easily grab the range for final answer is [max,sum] ,where max is the largest single value, sum is the total sum of whole array. Then we can apply binary search. But what if interviewer asked you to handle negative numbers?