Pergunta de entrevista da empresa Amazon

Medium/Hard level graph traversal Leetcode Question