Pregunta de entrevista de Google

Leetcode graph question that you solve with dps.