Pregunta de entrevista de Bloomberg

question from Leetcode (train schedule ...)