ABC Interview Question

about binary search and asked to implement binary search