Google Interview Question

Code an algorithm to give a list to compress a string (for example, "ggghhef" would be ["g", 3, "h", 2, "e", 1, "f", 1]