Amazon Interview Question

Graph question BFS based. And one sliding window problem.