Visa Inc. interview question

Binary Search with some modifications