Question d’entretien chez Oracle

Implement simple compression algorithm? Input: aaabbbccccc Output: a - 3 b - 3 c - 5