104. Furthest Building You Can Reach

Determine how far you can go across buildings, using bricks and ladders to climb to taller buildings.
Example 1
Input: heights = [4,2,7,6,9,14,12], bricks = 5, ladders = 1
Output: 4
Explanation: You can reach index 4.
Example 2
Input: heights = [4,12,2,7,3,18,20,3,19], bricks = 10, ladders = 2
Output: 7
Explanation: With two ladders and ten bricks, index 7 is reachable.
arrayshardheap
JavaScript
Loading...
Line 1, Char 1