Problem 443 · Medium

String Compression

Compress a character array in place by writing each character followed by its run length when the run is longer than one. The visual reads each run on one side and writes the compressed output at a shrinking write position.

Open the interactive visualisation