Leetcode 2182. Construct String With Repeat Limit
Given a multiset of lowercase letters and an integer repeatLimit, build the lexicographically largest string (you may omit characters) such that no letter appears more than repeatLimit times consecutively. The core challenge is a greedy ordering: repeatedly use the largest available letter up to the limit and insert the next-largest characters as needed to break runs.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.