Skip to content

Commit c1df207

Browse files
committed
124차 1번 문제풀이(참고)
1 parent 3b1331c commit c1df207

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sys
2+
3+
input = sys.stdin.readline
4+
5+
s = list(map(str, input().rstrip()))
6+
p = list(map(str, input().rstrip()))
7+
8+
9+
i = 0
10+
count = 0
11+
12+
while i < len(p):
13+
max_len = 0
14+
15+
for j in range(len(s)):
16+
l = 0
17+
while i + l < len(p) and j + l < len(s) and p[i + l] == s[j + l]:
18+
l += 1
19+
max_len = max(max_len, l)
20+
21+
i += max_len
22+
count += 1
23+
24+
print(count)
25+
26+
"""
27+
xy0z
28+
zzz0yyy0xxx
29+
30+
abaabba
31+
aaabbbabbbaaa
32+
"""

0 commit comments

Comments
 (0)