Pergunta de entrevista da empresa Google

Solve a graph and security level question (leetcode).