Amazon Interview Question

BFS question with a bar raiser Leetcode medium