Pregunta de entrevista de Skyscanner

There were two coding problems: the first was easy, and the second was a graph problem.