← Questions
Remove runs of repeated characters (1D candy crush)
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Repeatedly remove every run of at least k equal adjacent characters from a string until none is left, and return what remains. Removing a run can join two runs into a new one. Note that the whole run goes, not only k of it: with k = 3, abbbbc loses all four bs. A simpler version removes any group of two or more equal neighbours. Use a stack of (character, count).
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
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
