Arista Networks interview question

Question on string manipulation to collapse multiple lowercase consecutive elements into the letter and it's count. aaabbbccc -> a3b3c3