Compress String

Question A simple compression algorithm would be to replace repeating characters with their count. Example aaa --> a3 aaabb --> a3b2 aaabbaa --> a3b2a2 Want to stand out? Ask if there’s a difference between a & A and if you need to add uppercase & lowercase together or need to separate them. In my implementation I assumed they’re different. Code // start counting, then upon seeing a diff, write the count....

June 15, 2022 Β· 1 min