text, delete as few characters as possible so that no three adjacent characters are equal, and return the result. The answer can be shown to be unique.text='baaaad' → 'baad'
There are four a's in a row; dropping two of them leaves "baad".
text='xxyxxxx' → 'xxyxx'
The first pair of x's is already fine; of the four x's at the end, two remain.
text='abab' → 'abab'
No letter repeats three times in a row, so the string stays the same.
text consists of lowercase English letterstext='baaaad'
'baad'
Run checks the first 3 tests in your browser. Submit checks all 37 tests on the server, hidden ones included.