Pregunta de entrevista de Optiver

A harder leetcode style problem about graphs