Pregunta de entrevista de IBM

Sort intervals based on end time.