← Questions

Repeatedly remove runs of equal adjacent characters

0
MetaCodingLast asked Jan 2026

Remove every run of two or more equal adjacent characters, and keep doing it as new runs form, until none remain. For example xyyyx becomes xx and then the empty string. Do it in one pass with a stack of characters and run lengths.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding