🔥 Run-Length Encoding Forge

Compress strings by forging character counts into compact form

⚒️ Original String
Current Character
-
Count
0
✨ Compressed Output
🎯 Compressed String
-
0
Original Length
0
Compressed Length
0%
Compression Ratio
🔮 RLE Compression Algorithm
function compress(s):
result = "", count = 1
for i = 1 to s.length:
if s[i] == s[i-1]:
count++ // Same char, increment
else:
result += s[i-1] + count // Output pair
count = 1
result += s[last] + count
return result