You are given a string s and an integer repeatLimit. Construct a new string using characters from s such that no character appears more than repeatLimit times consecutively. You do not need to use all the characters from s.
Return the lexicographically largest string that can be formed under this condition.
A string a is lexicographically larger than a string b if, at the first position where they differ, string a has a letter that appears later in the alphabet than the corresponding letter in b, or if b is a prefix of a and a is longer.
Constraints:
repeatLimit s.length
s consists of lowercase English letters.
You are given a string s and an integer repeatLimit. Construct a new string using characters from s such that no character appears more than repeatLimit times consecutively. You do not need to use all the characters from s.
Return the lexicographically largest string that can be formed under this condition.
A string a is lexicographically larger than a string b if, at the first position where they differ, string a has a letter that appears later in the alphabet than the corresponding letter in b, or if b is a prefix of a and a is longer.
Constraints:
repeatLimit s.length
s consists of lowercase English letters.