#kotlinDevChallenge – 13
![](https://androidpro.io/wp-content/uploads/2023/11/Zrzut-ekranu-2023-11-15-o-13.51.35-1024x581.png)
Implement a string compressor Write a function that takes a string and returns a compressed version, where consecutive duplicate characters are replaced with a single character followed by the number of repetitions. For example, “aabccc” becomes “a2bc3”.