Pergunta de entrevista da empresa ByteDance

find cycle in a directed graph