A fancy string is a string in which no three consecutive characters are equal. Given a string `s`, delete the minimum possible number of characters from `s` to make it fancy, and return the final string. The answer is always unique.
A fancy string is a string in which no three consecutive characters are equal. Given a string s, delete the minimum possible number of characters from s to make it fancy, and return the final string. The answer is always unique.
Example 1:
Input: {"s":"leeetcode"}
Output: leetcode
Constraints:
1 <= s.length <= 10^5
s consists only of lowercase English letters.
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"s":"leeetcode"}
Start with an empty output. A character may join it unless the last two output characters are already that same letter.