Qualcomm Interview Question

write a binary search