Tell me about how you would implement a solution for a Mars Rover pathfinding problem.
Given a 2D grid of cells, a start position, and a target position, return the shortest path length from start to target, or -1 if no path exists. The rover can move up, down, left, or right, and cannot enter blocked cells.
mars_rover_path(grid, start, target)
grid: list of lists of integers, where 0 is open and 1 is blockedstart: [row, col]target: [row, col]-1def mars_rover_path(grid, start, target):