Arista Networks Interview Question

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