This problem forces you to modify an array in-place using a read pointer and a write pointer. You can't use extra space, so you need to overwrite the input as you go.
The technique here shows up whenever a problem says "do it in extra space." You'll learn to track group boundaries, count consecutive characters, and write compressed output without losing data you still need to read. Amazon values in-place algorithms because their systems handle massive data where memory allocation matters.