Coding

Implement String Compression

Implement string compression.

Input: chars = ["a","b","b","b","b","b","b","b","b","b","b","b","b"]

Output: ["a","b","1","2"]

Explanation: The letter 'a' appears once (so no number is appended), and 'b' appears 12 times, modifying the array in place to length 4.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

Community Answers

1 answer from the community

Expert Answer

Unlock Full Access

Answer any un-answered question from our database to unlock all community answers for 30 days.

Give & Take

Practice More Questions