import sys
def solution():
for i in range(len(str1)):
temp = 0
for j in range(len(str2)):
if temp < check[j]:
temp = check[j]
elif str1[i] == str2[j]:
check[j] = temp + 1
return max(check)
str1 = sys.stdin.readline().strip()
str2 = sys.stdin.readline().strip()
check = [0] * len(str2)
print(solution())
'파이썬 코테 준비' 카테고리의 다른 글
[백준 1012] 유기농 배추 - Python(파이썬) (0) | 2021.03.09 |
---|---|
[백준 2606] 바이러스 - Python(파이썬) (0) | 2021.03.09 |
[백준 2565] 전깃줄 - Python(파이썬) (0) | 2021.03.04 |
[백준 11054] 가장 긴 바이토닉 부분 수열 - Python(파이썬) (0) | 2021.03.04 |
[백준 12865] 평범한 배낭 - Python(파이썬) (0) | 2021.03.04 |
댓글