Acme Markets interview question

Binary Search coding question problem