Expedia Group Interview Question

Question on string manipulation based on number of characters