Remove entire repeated-character runs until stable, with explicit simultaneous-round semantics, cascading examples, a correct baseline, and optimization trade-offs.
Remove adjacent runs containing two or more equal characters, then continue removing repeated runs created by earlier deletions until the string is stable. Unlike pair cancellation, a run of three equal characters is removed completely.
### Constraints & Assumptions
The source describes deleting all repeated characters without a fixed k. For this practice version, each round removes every maximal run of length at least two simultaneously, then repeats. Confirm this policy because a left-to-right immediate-removal rule can differ.
### Clarifying Questions to Ask
- Are all runs in one round removed simultaneously?
- Should new runs exposed by deletions be removed in later rounds?
```hint Preserve run boundaries within a round
Do not let characters that were separated at the start of the round alter which original runs are removed in that same round.
```
### What a Strong Answer Covers
- Detecting maximal equal-character runs and dropping the whole run.
- Repeating until no deletion occurs under the stated round semantics.
- Correctness and the worst-case cost of repeated scans.
### Follow-up Questions
- How could linked run nodes and an affected-neighbor queue avoid rescanning the entire string?
- Give an input where pair cancellation differs from whole-run deletion.
Overview: Remove entire repeated-character runs until stable, with explicit simultaneous-round semantics, cascading examples, a correct baseline, and optimization trade-offs.
Remove adjacent runs containing two or more equal characters, then continue removing repeated runs created by earlier deletions until the string is stable. Unlike pair cancellation, a run of three equal characters is removed completely.
Constraints & Assumptions
The source describes deleting all repeated characters without a fixed k. For this practice version, each round removes every maximal run of length at least two simultaneously, then repeats. Confirm this policy because a left-to-right immediate-removal rule can differ.
Clarifying Questions to Ask Guidance
Are all runs in one round removed simultaneously?
Should new runs exposed by deletions be removed in later rounds?
What a Strong Answer Covers Guidance
Detecting maximal equal-character runs and dropping the whole run.
Repeating until no deletion occurs under the stated round semantics.
Correctness and the worst-case cost of repeated scans.
Follow-up Questions Guidance
How could linked run nodes and an affected-neighbor queue avoid rescanning the entire string?
Give an input where pair cancellation differs from whole-run deletion.