我的代码游记

标签 · 二分查找

首页

关于

归档

LeetCodeEasy二分查找

374.Guess Number Higher or Lower(Easy)

We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number is higher or lower.You call a pre-defined API guess(int num) which returns 3 possible results (-1, 1, or 0):我们来玩一个猜数游戏,游戏规则是这样的:我从1~n中选择一个数,你需要猜我选的数是哪一个,如果你猜错的话,我就会告诉你你猜的数比我..

更多