Question
Compute the fewest orthogonal moves from the start to the exit of a grid containing cells that can only be entered while travelling in one particular direction. ```python def solve(raw: str) -> str: ... ``` ## Requirements - Line 1 gives `rows cols`. The next `rows` lines each contain exactly `cols` characters. - `#` is a wall, `S` is the start, and `E` is the exit. - `>` can be entered only by moving right into it. `<` can be entered only by moving left into it. - The restriction applies when entering a directional cell. Once inside, the walker may leave in any direction. - `S`, `E`, and ordinary open cells accept entry from any side. - Each move goes one cell up, down, left, or right and costs one step. - Return the minimum number of moves from `S` to `E` as a decimal string, or `"-1"` when the exit cannot be reached. - The grid contains exactly one `S` and one `E`. - `run_case(case: dict)` forwards `case["stdin"]` to `solve`. - Do not append a trailing newline to the returned string; return the value exactly once.