import sys
txtVal = sys.stdin.readline().strip()
bomb = sys.stdin.readline().strip()
lastChar = bomb[-1]
lengthOfBomb = len(bomb)
stack = []
for char in txtVal:
stack.append(char)
if char == lastChar and ''.join(stack[-lengthOfBomb:]) == bomb:
del stack[-lengthOfBomb:]
ans = ''.join(stack)
if ans == "":
print("FRULA")
else:
print(ans)
'Algorithm > String' 카테고리의 다른 글
[백준] 3059번 등장하지 않는 문자의 합 (0) | 2021.02.08 |
---|---|
[백준] 1764번 듣보잡 (0) | 2021.02.08 |
[백준] 1213번 팰린드롬 만들기 (0) | 2021.01.08 |
[백준] 2941번 크로아티아 알파벳 (0) | 2020.11.25 |
[백준] 9012번 괄호 (0) | 2020.11.25 |
댓글