Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopgrid · bfs · shortest-path
The organizer’s problem statement is available at the official source link.
grid path
Visualize The Nilgiri Tahr
Reachable rocks form a grid graph; connect orthogonal neighbors only when their heights differ by at most one.
| start | rock | rock |
| rock | rock | rock |
| rock | rock | grass |
- 1
Encode the task
Reachable rocks form a grid graph; connect orthogonal neighbors only when their heights differ by at most one. - 2
Advance the state
Mark legal one-foot moves as edges, then trace a path from the top-left to the grass. - 3
Read the result
Use the final marked state to identify the requested answer.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.