Conveyor belt robot path
Your task
A warehouse robot moves on a grid: 'S' start, 'T' target, '.' floor, '#' wall, and conveyor cells '^','v','<','>'. A normal step into an adjacent non-wall cell costs 1 move. When the robot lands on a conveyor cell it is immediately and freely pushed in the arrow's direction, repeatedly, until it reaches a non-conveyor cell. If a conveyor pushes the robot into a wall, off the grid, or into an infinite loop of conveyors, that landing is invalid. Return the minimum number of moves to reach 'T', or -1 if impossible. Exactly one 'S' and one 'T' (both on non-conveyor cells).
Examples
warehouse_min_steps(grid: list[list[str]]) -> intExample 1
Input
warehouse_min_steps([["S", ">", "T"]])Output
1