Pergunta de entrevista da empresa Litmus7

Solve the DSA question based on hashing and BFS.