The Long Run
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant feedback.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L4
Problem
We're shrinking repetitive log lines before they land in cold storage. Collapse each stretch of the same character in a row into that character followed by how many times it repeats there, and return the compacted string.
Summary
Say it once, then say how many times it kept saying it.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and checks it automatically.