Function to count the available intervals from the given range of numbers
def findMaxIntervals ( start , end , n , R ) : NEW_LINE INDENT ans = 0 NEW_LINE prev = 0 NEW_LINE currActive = 0 NEW_LINE i = 0 NEW_LINE j = 0 NEW_LINE DEDENT