Visa Inc. Interview Question

Binary Search with some modifications