Not able to solve this question

how O(logN) is the answer