Pergunta de entrevista da empresa J.P. Morgan

Complicated Graph Traversal with several conditions