Limeroad Interview Question

A medium level coding problem related to binary search.