Pergunta de entrevista da empresa Tavant

Train chase question for the coding round.