Walmart Interview Question

code for binary search algorithm