Binary Search
The challenge gave a number guessing game between 1 and 1000 but we only have 10 tries.
By following the logic of binary search manually, we guess 500 (mid point) and then as per higher or lower prompt, we'll put values in between the current low and high limit (eg, if higher, then 750)
Algorithm I used:
(Could be wrong technically, but it is the rough idea I drew up)
Last updated