Binary Search
let it = lowerBound ( Ans , maximumIndexReached - B ) ; if ( it == - 1 ) { break ; } if ( it == maximumIndexReached - B ) { maximumIndexReached -- ; } else { break ; } } return maximumIndexReached ; }