[Python] 문자열 폭발 25.02.28

2025. 3. 1. 19:36

 

 


# 입력 받기
s = input().strip()
bomb = input().strip()

stack = []

for char in s:
	stack.append(char)
    
    if stack[-len(bomb):] == list(bomb)
    	for _ in range(len(bomb)):
        	stack.pop()
 
 # 결과 출력
 print(''.join(stack) if stack else "FRULA")

'Programming > 탭고리즘' 카테고리의 다른 글

[Python] 별 찍기-10 25.03.02  (0) 2025.03.02
[Python] 블랙잭 25.03.01  (0) 2025.03.01

BELATED ARTICLES

more