• 40.8%

https://leetcode.com/problems/decode-string/description/

Given an encoded string, return it’s decoded string.

The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.

You may assume that the input string is always valid; No extra white spaces, square brackets are well-formed, etc.

Furthermore, you may assume that the original data does not contain any digits and that digits are only for those repeat numbers, k. For example, there won’t be input like 3a or 2[4].

0ms, September 13, 2016

https://discuss.leetcode.com/topic/57228/0ms-simple-c-solution

https://discuss.leetcode.com/topic/57899/clean-c-recursive-solution-with-explanation

Clean C++ Recursive Solution with Explanation

Every time we meet a ‘[‘, we treat it as a subproblem so call our recursive function to get the content in that ‘[‘ and ‘]’. After that, repeat that content for ‘num’ times.
Every time we meet a ‘]’, we know a subproblem finished and just return the ‘word’ we got in this subproblem.
Please notice that the ‘pos’ is passed by reference, use it to record the position of the original string we are looking at.

https://discuss.leetcode.com/topic/63910/c-simple-and-clear-solution

C++ simple and clear solution

#### python

32ms, September 13, 2016

https://discuss.leetcode.com/topic/57121/share-my-python-stack-simple-solution-easy-to-understand

#### java

3ms, September 13, 2016

https://discuss.leetcode.com/topic/57159/simple-java-solution-using-stack