indexGreater = upper_bound ( arr , 0 , n , arr [ i ] + L ) ;
find Number of elements between the ith NEW_LINE index and indexGreater since the Numbers NEW_LINE are sorted and the elements are distinct NEW_LINE from the points btw these indices represent NEW_LINE points within range ( a [ i ] + 1 and a [ i ] + L ) NEW_LINE both inclusive NEW_LINE