Pregunta de entrevista de Jane Street

Graph based problem involving non-graph input and basic data structure analysis