Expedia Group Interview Question

Leetcode: change strings such as "aaaabb" to "a4b2"