I need to code a program that input will be any random string and the the output will include processes, unprocessed string.
Input String : XYZZXXYYXYZZXYZ
Unique Prefixes :
Encode List : [(0, 'X'), (0, 'Y'), (0, 'Z'), (3, 'X'), (1, 'Y'), (2, 'X'), (2, 'Z'), (4, 'Y'), (3, '')]
Encoded Binary String : 00101100000101100100010110101101011000001010110010100101100000100101101001000101100100011
Decoded String : XYZZXXYYXYZZXYZ
If anyone can help me with this. I am very thankful and appriciated.