Pregunta de entrevista de LinkedIn

Code questions about intervals problem. Not the same problem in LC