Compress repeated characters: compress("aaabccdddd") → "a3b1c2d4". Each run of the same character becomes the character followed by its count.
compress('aaabccdddd')
→ 'a3b1c2d4'compress('abc')
→ 'a1b1c1'Submit runs 5 tests, including hidden edge cases.
Run your code to see the output here.