Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopgrid · dynamic-programming · path-counting
The organizer’s problem statement is available at the official source link.
direction run grid
Add direction and run length to each intersection
A move continues straight only until the run limit; obstacles remove intersections from the route.
| intersection | -> | run d |
| ^ | v | |
| run 1 | <- | intersection |
- 1
Track direction
Start at the north-west intersection with no previous direction. - 2
Limit straight runs
Transition right/down while resetting or increasing the consecutive-run count. - 3
Sum valid paths
Sum route counts reaching the south-east exit across all valid states.
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.