Orgzit Interview Question

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