Google Interview Question

It is a leetcode about BFS