Amazon Interview Question

They asked me the problem based BFS which was Leetcode hard and much difficult to solve.