Pergunta de entrevista da empresa IDFC FIRST Bank

Coding question . They asked bfs with queue