Pergunta de entrevista da empresa Bloomberg

Graphs based question based on BFS, String formatting