《CITI》P112
1 数组与字符串
题目:
1.5 Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the “compressed” string would not become smaller than the original string, your method should return the original string.

本文介绍了一种基本的字符串压缩方法,该方法通过计算重复字符的数量来实现压缩。例如,字符串'aabcccccaaa'将被压缩为'a2b1c5a3'。如果压缩后的字符串长度不小于原始字符串,则返回原始字符串。

343

被折叠的 条评论
为什么被折叠?



