Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Expand a run-length encoded shift log

Python data engineering interview problem. Difficulty: beginner. Pattern: Strings. About 10 minutes. Part of the Pro drill bank.

The compact shift log from the compressor must be expanded back into the original sequence so humans can read it.

Expand a run-length encoded shift log back to the full string.

Requirements

  • Each count-character pair becomes that many copies.
  • The inverse of the compressor in the previous problem.

Constraints

  • s: compressed form.
  • Malformed pairs should follow the tests.

Examples

Input: rle_expand('a3b2c1') Output: 'aaabbc' This input follows the stated rules and produces this output.

Topics: lakebench, python, strings.

More Python interview questions · All interview problems · Learn data engineering

beginner

Expand a run-length encoded shift log

Interview-style drill: Expand a run-length encoded string back into its original repeated sequence.

Expand a run-length encoded shift log back to the full string.