Pregunta de entrevista de Tavant

Train chase question for the coding round.