Learn
Practice
Newsletter
Resources
Resume
New
F
Toggle theme
0
F
Toggle theme
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
heights
heap
4
2
7
6
9
14
12
algo
master
.
io
Step:
Start: Initialize algorithm
Variable
Value
heights
Array(7) [4, 2, 7...]
bricks
5
ladders
1
heap
-
bricks_used
-
Variable
Value
i
-
climb
-
smallest
-
return
-
0 / 14
Input
Example 1
Example 2
Only Bricks
Custom
heights
=
[4, 2, 7, 6, 9, 14, 12]
,
bricks
=
5
,
ladders
=
1
0 / 14
heights
heap
4
2
7
6
9
14
12
algo
master
.
io
Step:
Start: Initialize algorithm
Visualization
Variables