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.

No answers yet

Be the first to share your approach to this question

Practice More Questions