Orgzit interview question

write an compressing algorithm for given text. [input] aabbbbheefggh