๋ฌธ์ ๋งํฌ
https://www.acmicpc.net/problem/1120
์ฝ๋ ์ ์ถ ๊ธฐ๋ก (๋ฉ๋ชจ๋ฆฌ ๋ฐ ์๊ฐ)
์ ์ถ ๋ ์ง
@4/24/2021
๋ฉ๋ชจ๋ฆฌ
121220 KB
์๊ฐ
108 ms
Code
str1, str2 = map(str, input().split())
MIN = 100
def function(i):
global str1, str2
answer = 0
for x in range(len(str1)):
if str1[x] != str2[i+x]:
answer += 1
return answer
for i in range(len(str2) - len(str1) + 1):
MIN = min(MIN, function(i))
print(MIN)
Python
๋ณต์ฌ