Tap here to switch tabs
Problem
Submissions

Problem: Delete Characters to Make Fancy String

med
30 min
Try to solve the Delete Characters to Make Fancy String problem.

Statement

A fancy string is defined as a string where no 33 consecutive characters are identical.

Given a string s, delete the minimum number of characters from s to make it a fancy string.

Return the resulting string after performing the deletions. It can be shown that the final answer is always unique.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists only of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Delete Characters to Make Fancy String

med
30 min
Try to solve the Delete Characters to Make Fancy String problem.

Statement

A fancy string is defined as a string where no 33 consecutive characters are identical.

Given a string s, delete the minimum number of characters from s to make it a fancy string.

Return the resulting string after performing the deletions. It can be shown that the final answer is always unique.

Constraints:

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s consists only of lowercase English letters.