Understanding the Problem
Get an overview of the problem in this chapter and try to understand it.
We'll cover the following
Problem
There is a treasure hidden in a building with 50 rooms. Our task is to guess the room with the treasure within six attempts. When we enter a room number, the window will light up. With each guess, the computer will give us one of these hints:
-
“Wrong guess! Your guess is too low.”
-
“Wrong guess! Your guess is too high.”
-
“Congratulations! The number is correct.”
On the list of our room number guesses, the arrow next to the most recent room number tells the direction in which we should move. If the arrow points upward, we should guess a higher number. Similarly, if the arrow points downward, we should guess a lower number.
Get hands-on with 1400+ tech skills courses.