Walmart interview question

Binary search