NatWest Group Interview Question

write code for binary search algorithm