Write a command-line tool /solve in Python that reads a grid problem from stdin and outputs the shortest…
Write a command-line tool /solve in Python that reads a grid problem from stdin and outputs the shortest…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input format (stdin): - First line: two integers rows cols (1 ≤ rows, cols ≤ 1000) separated by whitespace. -…
The task
**Input format (stdin):** - First line: two integers `rows cols` (1 ≤ rows, cols ≤ 1000) separated by whitespace. - Next `rows` lines: each contains `cols` characters from the set `.#SGE`: - `.` walkable (cost 1) - `#` wall (impassable) - `S` start tile (exactly one, walkable, cost 1 to leave) - `G` goal tile…
Part of ai-and/termgrade-environments.