Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Cherry Pickup
Bookmark
Input
Example 1
Example 2
Example 3
Blocked Path
Mixed
Custom
grid
=
[[0,1,-1],[1,0,-1],[1,1,1]]
grid =
3x3
grid
dp[r1][r2]
0
1
X
1
0
X
1
1
1
two walkers collect cherries from corner to corner; shared cells count once
algo
master
.
io
Step:
Two walkers go top-left to bottom-right at the same time, picking cherries. Shared cells count once
0 / 18
Input
Example 1
Example 2
Example 3
Blocked Path
Mixed
Custom
grid
=
[[0,1,-1],[1,0,-1],[1,1,1]]
0 / 18
grid =
3x3
grid
dp[r1][r2]
0
1
X
1
0
X
1
1
1
two walkers collect cherries from corner to corner; shared cells count once
algo
master
.
io
Step:
Two walkers go top-left to bottom-right at the same time, picking cherries. Shared cells count once