LearnPy Hub
← Arena
AdvancedRating 1600

Decode Nested Repeats

Decode strings like 3[a2[c]] → accaccacc: k[text] repeats text k times; brackets nest.

Input

One line.

Output

The decoded string.

Sample 1

Input
3[a]2[bc]
Output
aaabcbc

Sample 2

Input
3[a2[c]]
Output
accaccacc
solution.py
Output appears here
Decode Nested Repeats · Python Arena problem · LearnPy Hub