Sign InCreate Account

Upgrade to Pro

Upgrade Now

Coding Workspace

EditorProjectsPractice QuestionsTimed Mock ExamsFlowcharts

PseudoEditor AI

Pseudocode TutorCode GeneratorCode FixerCode Converter
Back to Problems
PreviousNext

Sign in to run tests against edge cases and save your code automatically.

Problem Description

Hard

Run-Length Encoding

PROStrings
Run-Length Encoding
Iteration

Run-length encoding compresses a string by replacing each run of identical consecutive characters with the character and the length of the run. Write a program that inputs a non-empty string of lowercase letters. For each run, in order, output the character on one line and the run length on the next line. For example, `aaabbc` has runs of 3 `a`s, 2 `b`s and 1 `c`, so the output is: ``` a 3 b 2 c 1 ```

Example Input

aaabbc

Example Output

a 3 b 2 c 1

Success Rate:

0% (0 passed / 0 attempted)

Code

Draft auto-saved

Test Results

Click "Test Code" to evaluate your code against the tests.

Product

For SchoolsOverviewFeaturesFAQ
PseudoEditor

© 2026 PseudoEditor. All rights reserved.