Amazon Interview Question

binary search leet code problem