갓언어
https://www.acmicpc.net/problem/3111
s=input()
r=input()
b=True
while True:
if b:
i=r.find(s)
else:
i=r.rfind(s)
if i==-1:
print(r)
break
else:
b=not b
r=r[0:i]+r[i+len(s):]
갓언어
https://www.acmicpc.net/problem/3111
s=input()
r=input()
b=True
while True:
if b:
i=r.find(s)
else:
i=r.rfind(s)
if i==-1:
print(r)
break
else:
b=not b
r=r[0:i]+r[i+len(s):]
와이걸정공법으로풀었다고? 시간초과안남? - dc App
첨에 재귀함수로 짰더니 메모리 초과나서 while 문으로 다시 만듬 ㅇㅅㅇ; 보셈 나 숏코딩 3번째 됨
결국 최적화 문제였네 와 - dc App