Cruise interview question

Leetcode easy/medium BFS/DFS question involving nested arrays.