【题目】
【代码】
class Solution:
def guessNumber(self, n: int) -> int:
left,right=1,n
while left<=right:
mid=left+(right-left)//2
temp=guess(mid)
if temp==0:
return mid
elif temp>0:
left=mid+1
else:
right=mid-1
return left