Write a program to do basic string compression. For a character which is repeated more than once, replace consecutive duplicate occurrences with the count of repetitions e.g. if a String has 'x' repeated 5 times, replace this "xxxxx" with "x5".
Note : You don't need to print the changed string.
Login to submit your solution