Databricks Interview Question

Standard BFS Leetcode style question