Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2865. Beautiful Towers I
Given an array of tower heights where you may only decrease values, reshape it into a mountain (nondecreasing up to one or more equal peak(s), then nonincreasing) to maximize the total sum of heights. The core challenge is, for each candidate peak, to optimally lower elements on both sides (without increasing any) so the sequence is valid and the sum is maximized.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.