Pergunta de entrevista da empresa ServiceNow

* most of the problem can be solved with hash map. Only one involved graph