1mg Interview Question

DSA : problem based on graph BFS traversal