RUN LENGTH ENCODING

 RUN LENGTH ENCODING.


Given a string containing uppercase characters (A-Z), compress the string using Run Length encoding. Repetition of character has to be replaced by storing the length of that run.

Write a python function which performs the run length encoding for a given String and returns the run length encoded String.

Provide different String values and test your program

Sample Input

Expected Output

AAAABBBBCCCCCCCC

4A4B8C

AABCCA

2A1B2C1A






CODE :




Enjoy! Enjoy! Enjoy! Enjoy! Enjoy!

Post a Comment

0 Comments