You get get 6 attempts to find the number between 1-100. Each "attempt" can either be a guess, or a range it could fall in, responses you could receive are "Correct!", "My number is lower.", "My number is higher", or "My number is within that range".
You have 6 tries to guess it, NOT to know it.
If you can do it in less than 6 please do post it.
Answer
Divide the current range by three and guess the middle range. It's either correct, higher, or lower, which reduces your search space by ⅔. You'll go from a search space of 100 to (worst case) 34, to 12, to 4, to 2, to 1 which you can state on your 6th guess.
No comments:
Post a Comment