Solution: Decode String

Let’s solve the Decode String problem using the Stacks pattern.

We'll cover the following...

Statement

Given an encoded string, return its decoded version. The encoding rule follows the pattern: k[encoded string]k[encoded~string], where the encoded stringencoded~string is repeated exactly kk times.

Note: The kk is guaranteed to be a positive integer.

Assume that the input string is always ...