재미있는 9935(스택+문자열)

This commit is contained in:
yenru0 committed 2020-08-12 06:28:18 +09:00
1 parent 4be6fe4105
commit 811f86e100
2 files changed
+23

No files matched your search

View File
Whitespace-only changes.
+23
View File
@@ -0,0 +1,23 @@
I = input()
R = input()
r = len(R)
before = ""
T = []
for s in I:
if R[-1] == s:
if len(T) < r - 1:
pass
else:
for i in range(r - 1):
if T[1 - r + i] != R[i]:
break
else:
for i in range(r - 1):
T.pop()
continue
T.append(s)
if T:
print("".join(T))
else:
print("FRULA")