由买买提看人间百态

topics

全部话题 - 话题: abc5xp
(共0页)
a******e
发帖数: 710
1
两个问题
1. Abckkkkkkkkkkks55p=> Abc11xk55p => Abckkkkkkkkkkks55p
55前面的s去哪里了? 是typo么?
2. Abc5xp这个不就是应该decode成Abcppppp么?
我猜你想问的问题是这个吧?
如果原来字符串就是Abc5xp的话,要encode成什么?
j********r
发帖数: 25
2
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
发帖数: 25
3

[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.
(共0页)