Given an encoded string, return its decoded version. The encoding rule follows the pattern:
Note: The
k is guaranteed to be a positive integer.
Assume that the input string is always valid, meaning there are no extra spaces, and the square brackets are properly balanced and well-formed. Additionally, assume that the original data contains no digits and that digits are only used for repeating the string.
For example, the input will not contain patterns like
Given an encoded string, return its decoded version. The encoding rule follows the pattern:
Note: The
k is guaranteed to be a positive integer.
Assume that the input string is always valid, meaning there are no extra spaces, and the square brackets are properly balanced and well-formed. Additionally, assume that the original data contains no digits and that digits are only used for repeating the string.
For example, the input will not contain patterns like