XorLabs interview question

Binary search