Re: 0ms c++ binary search
why use (maxNumber+minNumber)/2 over flow????????
You should use Max+(Max-Min)/2, For example, if the high is 2^31 and low is a constant larger than 1, low+high is over flow, since in java we use 32 byte to storage the int.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.