Apple Interview Question

Matrix Shortest path