Run-Length Encoding
Medium
Strings
Compress a string by replacing every run of identical consecutive characters with the character followed by the run length. Print the encoded string.
Constraints
1 <= len(s) <= 10^5 Lowercase English letters
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.