Route interview question

Leetcode style BFS medium question