Pergunta de entrevista da empresa TikTok

Asked a Leetcode hard graph question