Microsoft Interview Question

A binary search problem which can be found on leetcode