Databricks Interview Question

Matrix manipulation, depth first search