eBay Interview Question

leetcode easy/medium array question with binary search.