diff --git "a/problems/0030.\345\255\227\347\254\246\344\270\262\350\247\243\345\216\213\347\274\251.md" "b/problems/0030.\345\255\227\347\254\246\344\270\262\350\247\243\345\216\213\347\274\251.md" index d0c96d98036cf307eac565e438ef5054431a8ad0..b3dd0958ff0d00a4c74d874cb80d3d33e15bbf3b 100644 --- "a/problems/0030.\345\255\227\347\254\246\344\270\262\350\247\243\345\216\213\347\274\251.md" +++ "b/problems/0030.\345\255\227\347\254\246\344\270\262\350\247\243\345\216\213\347\274\251.md" @@ -123,6 +123,33 @@ public class Main { ## Python +s = input() +stack = [] +for i in range(len(s)): + + stack.append(s[i]) + if s[i] == ']': + stack.pop() + abc = [] + num = [] + flag=0 + while stack[-1]!='[': + x = stack.pop() + if x == '|': + flag = 1 + continue + if flag == 0: + abc.append(x) + + elif flag == 1: + num.append(x) + stack.pop() + stack.append(''.join(map(str,abc[::-1]))*int(''.join(map(str, num[::-1])))) +print(''.join(map(str,stack))) + + + + ## Go ## JS