LeetCode
Guess Number Higher or Lower II
Click
here
for an explanation.