Better Compression
An Atlassian interviews coding interview problem: Given S, a mis-compressed string of lowercase letters followed by counts (e.g., a3c9b2c1), this interview question asks you to return the correctly compressed form by combining repeated letters and listing each letter once in alphabetical order with its total count.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
