Minimum obstacle removal

Write codeHard30 minGoogle style

Your task

A robot starts at the top-left of an R x C grid and wants to reach the bottom-right. Cell value 0 is open and 1 is an obstacle; the robot may remove obstacles but wants to remove as few as possible. Moving to an adjacent cell (up/down/left/right) costs one removal if that cell is an obstacle, nothing if it's open. Entering the start or end cell also counts if it happens to be an obstacle. Return the minimum number of obstacles that must be removed to reach the bottom-right cell.

Examples

min_obstacles(grid: list[list[int]]) -> int
Example 1
Inputmin_obstacles([[0, 1, 1], [1, 1, 0], [1, 1, 0]])
Output2