์‹ค๋ฒ„4 : ๊ทธ๋ฆฌ๋”” ๋ฌธ์ œ์ด๋‹ค.

ํ’€์ด

๋‹จ์ˆœํ•œ ๋ฌธ์ œ์ด๋‹ค. ์•ž๋’ค์— ์–ด๋– ํ•œ ๋ฌธ์ž๋ฅผ ๋„ฃ์„ ์ˆ˜ ์žˆ์œผ๋‹ˆ, ํ˜„์žฌ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋ฌธ์ž์—ด๋งŒ ๊ฐ€์ง€๊ณ ์„œ ๋ถ€๋ถ„์ ์œผ๋กœ ๋ณด์•˜์„ ๋•Œ, ๊ฐ€์žฅ ์ž‘์€ ์ฐจ์ด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ง€์ ๋งŒ ์•Œ๋ฉด๋œ๋‹ค. ์ดํ›„๋Š” ๋งž์ถฐ์„œ ๋ผ์›Œ๋„ฃ์œผ๋ฉด ๋˜๋‹ˆ๊นŒ.

Code

A, B = input().split()
 
min_diff = 100
for i in range(len(B) - len(A) + 1):
    diff = 0
    for j in range(len(A)):
        if A[j] != B[i + j]:
            diff += 1
    min_diff = min(min_diff, diff)
 
print(min_diff)

Reference