Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2234. Maximum Total Beauty of the Gardens
Choose which gardens to raise to at least target using at most newFlowers to maximize full * (#complete) + partial * (minimum flowers among incomplete gardens). The problem reduces to sorting and using prefix sums to try each possible number of completed gardens and greedily/binary-search raising the minimum of the rest with leftover flowers to find the maximum beauty.
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.