We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a5a7fb commit e0ced62Copy full SHA for e0ced62
1 file changed
live9/test99/문제3/백한결.py
@@ -0,0 +1,25 @@
1
+def solution(s):
2
+ count = 0
3
+
4
+ rightGaulHoList = ["()", "[]", "{}"]
5
6
+ for i in range(len(s)):
7
+ stack = []
8
+ rotated = s[i:] + s[:i]
9
10
+ print(rotated)
11
12
+ for j in rotated:
13
+ if j == "(" or j == "[" or j == "{":
14
+ stack.append(j)
15
16
+ elif j == ")" or j == "]" or j == "}":
17
+ if stack:
18
+ total = stack[-1] + j
19
20
+ if total == "()" or total == "[]" or total == "{}":
21
+ count += 1
22
+ else:
23
+ break
24
25
+ return count
0 commit comments