Nuclei interview question

Graph question based on dfs, shortest path algo