You are given a string . Suppose a character '' occurs consecutively times in the string. Replace these consecutive occurrences of the character '' with in the string. For a better understanding of the problem, check the explanation. code example
Example: You are given a string S. Suppose a character ‘c’ occurs consecutively X times in the string. Replace these consecutive occurrences of the character ‘c’ with (X, c) in string
(1, 1) (3, 2) (1, 3) (2, 1)