Pregunta de entrevista de Bloomberg

Graphs based question based on BFS, String formatting