Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2866. Beautiful Towers II
Choose heights within [1, maxHeights[i]] that form a mountain (nondecreasing to a single peak then nonincreasing) to maximize the total sum. Core challenge: for each possible peak, compute the best feasible left/right height profiles under the monotonic constraints (commonly done with prefix/suffix scans or monotonic stacks) and take the maximum total.
Asked at:
Bloomberg
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid September, 2025
Bloomberg
Mid-level
https://leetcode.com/problems/beautiful-towers-ii/
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.