A BrainOS robot represents a mapped floor area as a rectangular grid. Free cells are marked 0, and blocked cells such as walls or unavailable areas are marked 1. Given a start cell and a goal cell, return the shortest route the robot can follow using four-directional movement.
If multiple shortest routes exist, explore neighbors in this order: up, right, down, left. Return the first route produced by that ordering. If the goal cannot be reached, return an empty list.
Implement navigate_grid(grid, start, goal).
grid is a non-empty rectangular list of lists containing integers 0 or 1.start and goal are two-element lists [row, column] identifying free cells.start and ending with goal, or [] when no route exists.def navigate_grid(grid, start, goal):