We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4848673 commit 93023daCopy full SHA for 93023da
1 file changed
live11/test112/문제2/박희경.py
@@ -0,0 +1,29 @@
1
+import sys
2
+
3
+input = sys.stdin.readline
4
5
+result = 0
6
+def bt(word, length):
7
+ global result
8
+ if len(word) == length:
9
+ if word == s:
10
+ result = 1
11
+ return
12
13
+ if word[-1] == 'A':
14
+ bt(word[:-1], length)
15
+ if word[0] == 'B':
16
+ bt(word[1:][::-1], length)
17
18
+s = input().rstrip()
19
+t = input().rstrip()
20
+bt(t, len(s))
21
22
+print(result)
23
+"""
24
+A
25
+BABA
26
27
28
+ABBA
29
0 commit comments