Navan interview question

It was a BFS type question.