Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Furthest Building You Can Reach
Bookmark
Input
Example 1
Example 2
Only Bricks
Custom
heights
=
[4, 2, 7, 6, 9, 14, 12]
,
bricks
=
5
,
ladders
=
1
4
0
2
1
7
2
6
3
9
4
14
5
12
6
spend bricks on small climbs, save ladders for the big ones
algo
master
.
io
Step:
Start: heights = [4, 2, 7, 6, 9, 14, 12], bricks = 5, ladders = 1
0 / 14
Input
Example 1
Example 2
Only Bricks
Custom
heights
=
[4, 2, 7, 6, 9, 14, 12]
,
bricks
=
5
,
ladders
=
1
0 / 14
4
0
2
1
7
2
6
3
9
4
14
5
12
6
spend bricks on small climbs, save ladders for the big ones
algo
master
.
io
Step:
Start: heights = [4, 2, 7, 6, 9, 14, 12], bricks = 5, ladders = 1