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.
Jump to Post
With the encoded text, I would go with dictionary rather than tuples.
As for the prefix stuff, try split.('sting')
for the unique prefixes take a look at itertools
All 6 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.