Double golf


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
Contest ID
0009
Writer
admin
Publish date
2021/05/13 23:00:00
Solved
342
Best
2
Top player
BTLNM