Databricks interview question

Matrix manipulation, depth first search