Pregunta de entrevista de Bloomberg

Leetcode Medium graph question + follow ups (time complexity)