Computer Science/백준 알고리즘
[백준] 12904번 A와 B (파이썬)
roytravel
2022. 6. 28. 23:59
import sys
def do_deduction(S, T):
while True:
if len(S) == len(T):
if S == T:
print (1)
else:
print (0)
return
if T[-1] == "A":
T = T[:-1]
else:
T = T[:-1][::-1]
if __name__ == "__main__":
input = sys.stdin.readline
S = input().strip()
T = input().strip()
do_deduction(S, T)