Microsoft interview question

A binary search problem which can be found on leetcode