NeetCode #810LC-2182MediumGreedy
← Back to All Problems#810 · #2182 · Construct String With Repeat Limit(构造限制重复的字符串)
📌 Problem Statement & Constraints
Given a string
s and an integer repeatLimit, construct the lexicographically largest string from the characters of s such that no character is repeated more than repeatLimit times consecutively. You do not have to use all characters. Constraints: 1 <= s.length <= 10^5, 1 <= repeatLimit <= s.length, s consists of lowercase English letters.🔒
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!