Question: Implement a Codec. => => Abckkkkkkkkkkks55p=> Abc11xk55p => Abckkkkkkkkkkks55p 也就是说,对于两个以上的重复字符,编码成 [n]x[c] where n is the repetition count and c is the actual character, 比如以上的11为k的重复数,x是特殊字符,k是重复的字符。 中间会有special case, 比如: Abc5xp, If you directly output above sequence, the decoder could decode it as: Abcppppp, 这种情况你应如何处理.
【在 j********r 的大作中提到】 : Question: Implement a Codec. : => => : Abckkkkkkkkkkks55p=> Abc11xk55p => Abckkkkkkkkkkks55p : 也就是说,对于两个以上的重复字符,编码成 : [n]x[c] where n is the repetition count and c is the actual : character, : 比如以上的11为k的重复数,x是特殊字符,k是重复的字符。 : 中间会有special case, 比如: : Abc5xp, If you directly output above sequence, the decoder could decode it : as:
o*o
6 楼
同问cvs,sfw之外的丢。
j*r
7 楼
[jobhangter] yes, it's typo, should be: 1. Abckkkkkkkkkkks55p=> Abc11xks55p => Abckkkkkkkkkkks55p [jobhangter] Yes, what if the source string is Abc5xp, how do you encode it . especially how to write code to handle the special cases.