Databricks interview question

Find shortest path in a 2'd sorted array