Design Compressed String Iterator Problem

Design Compressed String Iterator Problem — ExecCode Easy DSA Practice

Solve the Design Compressed String Iterator problem on ExecCode. Free online easy DSA practice in Design. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Design Compressed String Iterator. Your task is to compute the required answer and return one character per next, line-separated. A text tool receives characters in a specific order. In Design Compressed String Iterator, the answer depends on handling those characters carefully, including duplicates and order. data: encoded string then next commands.

Examples

Input {"data": "L1e2\nnext\nnext\nnext\nnext"}; Output L e e. Input {"data": "a2b1c2\nnext\nnext\nnext\nnext\nnext"}; Output a a b c c. Input {"data": "x10\nnext\nnext\nnext\nnext\nnext\nnext\nnext\nnext\nnext\nnext\nnext"}; Output x x x x x x x x x x

Constraints

Valid encoding format per samples

Practice Design Compressed String Iterator free on ExecCode. Browse DSA problems, topic map, and placement guides.