Use iterative binary search here


#1

Hint is in the topic