Your question is Shortest Path in Grid Lot. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an m x n grid of integers, find the length of the shortest path from a start cell to a destination cell. Each cell is either open (0) or blocked (1). You may move one step at a time in four directions: up, down, left, or right. Return the minimum number of steps needed to reach the destination, or -1 if no path exists.
def shortest_path_grid(grid, start, end):