#K35427. Decode String

    ID: 25529 Type: Default 1000ms 256MiB

Decode String

Decode String

Problem Description:

Given an encoded string, return its decoded string. The encoding rule is: \(k[encoded\_string]\), where the encoded string inside the square brackets is repeated exactly \(k\) times. You may assume that the input string is always valid (no extra white spaces, and the brackets are well-formed).

For example:

  • 3[a]2[bc] returns aaabcbc
  • 3[a2[c]] returns accaccacc

inputFormat

The input consists of a single line containing the encoded string.

outputFormat

Output a single line containing the decoded string.

## sample
3[a]2[bc]
aaabcbc