Statement | You are given string S contains only '[', ']' and 'o'. Repeat twice a string surrounded by parentheses. Parentheses can be wrapped so you may have to expand recursively. Constraints * 1 ≤ |S| ≤ 15 * Parentheses matches validly Explanation for sample "oo[o[oo][[]o]]o" ↓ "oo[ooooo[[]o]]o" ↓ "oo[ooooo[o]]o" ↓ "oo[ooooooo]o" ↓ "ooooooooooooooooo" |
---|---|
Sample Input | |
Sample Output |