Question: please solve this can you please help me can you share me link where there are scenario based question tomorrow is my final exam Write

please solve this can you please help me can you share me link where there are scenario based question tomorrow is my final exam


Write a program to do basic string compression. For a character which is consecutively repeated more than once, replace consecutive duplicate occurrences with the count of repetitions. Example: If a string has ' x ' repeated 5 times, replace this "xxxxx" with " x5. The string is compressed only when the repeated character count is more than 1. Consecutive count of every character in the input string is less than or equal to 9 . Input Format: The first and only line of input contains a string without any leading and trailing spaces. Consecutive count of every character in the input string is less than or equal to 9. Input Format: The first and only line of input contains a string without any leading and trailing spaces. Output Format: The output contains the string after compression printed in single line. Note: You are not required to print anything. It has already been taken care of. Just implement the given function. Constraints: 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
