mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2026-04-05 03:48:15 +08:00
415 B
415 B
id, title, topics, difficulty
| id | title | topics | difficulty | |
|---|---|---|---|---|
| 6 | String Compression and Decompression |
|
easy |
Question
'''
Given a string, compress it by grouping repeated characters. The length after
compression must always be smaller than or equal to the original string.
'aaabbccc' => 'a3b2c3'
'''
'''
Given the above compressed string, decompress to obtain the original string.
'a3b2c3' => 'aaabbccc'
'''