-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
Add changes to README.md
Change this:
setRange(min, max)
this method accepts min and max value of range of number to guess
To this:
setRange(min, max)
this method accepts min (not included) and max (included) value of range of number to guess,
in mathematics that would be (min, max]
Why do so
The proposed changes leave less room for ambiguity.
The solution that passes all tests does not find the min value of method setRange,
no matter how many times method lower is called.
It implies that min is not included in the searching range.
Possibly because of that a common binary search algorithm that can actually find min won't pass most of the tests.
The solution that passed 100% of the tests won't find the min value 0 of setRange(0, 4)
const game = new GuessingGame;
game.setRange(0, 4);
console.log(game.guess()); // 2
game.lower();
console.log(game.guess()); // 1
game.lower();
console.log(game.guess()); // 1
game.lower();
console.log(game.guess()); // 1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels