Want to solve this problem? Login now to get access to solve the problems
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.
The first and only line of input contains a string without any leading and trailing spaces.
The only line of output prints the updated string.
You are not required to print anything. It has already been taken care of, just implement the function.
1 <= N <= 10^6 Where N is the length of the input string. Time Limit: 1 second