Run-Length Encoding

Compress strings by replacing sequences of identical characters with that character followed by a count.

Easy5/15/2024

Problem statement

Run-length encoding (RLE) compresses strings by replacing sequences of identical characters with that character prefixed by a count. For instance, aaaabcccaa should be compressed to 4a1b3c2a.

Problem leaderboard

#
Size
%
Users
#1
42 c.
Top 56%
+4
voytxt
helbling
alexisab
c
Bull
madeforlosers
Thomasdcrt
maximec-indy
smclaughlin-cf
Steffan
#2
43 c.
Top 60%
Mif712
#3
46 c.
Top 64%
ComputerKWasTaken
#4
47 c.
Top 68%
SephQ
#5
50 c.
Top 72%
emma
#6
52 c.
Top 76%
XenThe
#7
54 c.
Top 80%
Seboran
#8
55 c.
Top 84%
KrausRaus
#9
76 c.
Top 88%
thaispalmer
#10
408 c.
Top 92%
Luke
#11
411 c.
Top 96%
Arnaud
#12
1065 c.
Top 100%
Alex