HF RL Explorer

Implement a minimal-pathfinding program that reads a grid from stdin and writes the shortest path length to…

Implement a minimal-pathfinding program that reads a grid from stdin and writes the shortest path length to…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Grid format (stdin): - First line: two positive integers rows cols separated by one space (1 ≤ rows,cols ≤…

The task

Grid format (stdin): - First line: two positive integers `rows cols` separated by one space (1 ≤ rows,cols ≤ 10^6, but total cells ≤ 10^6). - Next `rows` lines: each has exactly `cols` characters from the set {`S`,`G`,`#`,`.`,`0`–`9`}. - `S` = start (exactly one occurrence). - `G` = goal (exactly one occurrence). -…

Part of ai-and/termgrade-environments.