SEARCH-FOR-A-RANGE solved with binary search