Simple binary search, be careful on the exit condition

```
class Solution(object):
def guessNumber(self, n):
"""
:type n: int
:rtype: int
"""
left = 1
right = n
while left <= right:
mid = (left + right) >> 1
g = guess(mid)
if g == 0:
return mid
elif g == 1:
if left == mid:
return left+1
left = mid
else:
right = mid
```