0

Problem:
Given a string aaabbcccaad print the no. of occurrence of the character in the same order in which the character occurred.
Expected output:
(a, 3), (b, 2), (c, 3), (a, 2), (d, 1)
The approach:
Loop through each character.
When the next character is not same as the current character, rec...