Pregunta de entrevista de IDFC FIRST Bank

Coding question . They asked bfs with queue