CLEAR interview question

2D depth first search / leetcode hard