eBay interview question

leetcode easy/medium array question with binary search.