Pergunta de entrevista da empresa Cisco

Asked a question of bfs and dynamic programming combined