Solve Grid Path and Graph Sampling | Databricks Coding Question