Pergunta de entrevista da empresa Google

A tough programming question related directed graph