NeetCode #536LC-1642MediumHeap / Priority Queue
← Back to All Problems#536 · #1642 · Furthest Building You Can Reach(可以到达的最远建筑)
📌 Problem Statement & Constraints
You are given
heights of buildings, bricks and ladders. Moving from building i to i + 1 requires the height difference in bricks, or one ladder (usable regardless of the difference). Return the furthest building index reachable. Constraints: 1 <= heights.length <= 10^5, 0 <= bricks <= 10^9, 0 <= ladders <= heights.length.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!