Run-length encode a string by collapsing consecutive identical characters.
Constraints
Example
>>> compress("aaabbc")
'a3b2c1'
>>> compress("a")
'a1'
>>> compress("")
''
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints