Problem:
 Score : 200 points    Problem Statement Given are two strings S and T .  Let us change some of the characters in S so that T will be a substring of S .  At least how many characters do we need to change?  Here, a substring is a consecutive subsequence. For example, xxx is a substring of yxxxy , but not a substring of xxyxx .      Constraints  The lengths of S and T are each at least 1 and at most 1000 .  The length of T is at most that of S .  S and T consist of lowercase English letters.         Input Input is given from Standard Input in the following format:  S  T       Output Print the minimum number of characters in S that need to be changed.        Sample Input 1 cabacc
abc      Sample Output 1 1  For example, changing the fourth character a in S to c will match the second through fourth characters in S to T .  Since S itself does not have T as its substring, this number of changes - one - is the minimum needed.       Sample Input 2 codeforces
atcoder      Sample Output 2 6

Solution (Python):
S = input()
T = input()
Sn = len(S)
Tn = len(T)
ans = 0

for i in range(Sn-Tn+1):
    M = 0
    for j, k in zip(S[i:], T):
        if j == k:
            M += 1
    
    if M > ans:
        ans = M

print(Tn - ans)

Solution (Python):
s = input()
t = input()

ans_list = []
end = len(s) - len(t) + 1
for i in range(end):
    word = s[i:i+len(t)]
    tmp = 0
    for j in range(len(t)):
        if t[j] != word[j]:
            tmp += 1
    ans_list.append(tmp)

ans_list.sort()
ans = ans_list[0]

print(ans)

Solution (Python):

S = input()
T = input()

cnt = 0
l = []
for i in range(len(S)-len(T)+1):
    text = S[i:i + len(T)]
    for j in range(len(T)):
        if text[j] == T[j]:
            cnt += 1
    l.append(cnt)
    cnt = 0

print(len(T)-max(l))

Solution (Python):
S = input()
T = input()
m = len(T)
for i in range(len(S)-len(T)+1):
    a = S[i:(i+len(T))]
    count = 0
    for j in range(len(a)):
        if a[j] == T[j]:
            count += 1
    if len(T)-count < m:
        m = len(T)-count
print(m)

Solution (Python):
S = input()
T = input()
new = list(S)
main = list(T)

thelist = []

for i in range(len(new)):
    if len(new[i:i+len(main)]) < len(main):
        break
    thelist += [new[i:i+len(main)]]

counter = 0

for lists in thelist:
    second_counter = 0
    for i in range(len(main)):
        if main[i] != lists[i]:
            second_counter += 1
    if counter == 0:
        counter = second_counter
    elif second_counter < counter:
        counter = second_counter
print(counter)

Solution (Python):
a = input()
b = input()
d = []
for i in range(0,len(a)-len(b)+1):
    c = 0
    for j in range(0,len(b)):
        if a[i+j] != b[j]:
            c = c + 1
        
    d.append(c)

print(min(d))

Solution (Python):
S = list(input())
T = list(input())

def diff(s,t):
    count = 0
    
    for i in range(len(t)):
        if s[i]!=t[i]:
            count+=1
    
    return count
min_c = diff(S,T)

for i in range(len(S)-len(T)):
    d = diff(S[i:],T)
    
    if d<min_c:
        min_c = d
print(min_c)

Solution (Python):
S = input()
T = input()

mS = []
d = len(S) - len(T)
m = 0

if len(S) == len(T) :
    for i in range(len(T)):
        if S[i] != T[i] :
            m += 1
    print(m)

else :

    for j in range(d):
        m = 0
        for i in range(len(T)):
            if S[i] != T[i] :
                m += 1

        mS.append(m)
        S = S[1:]
    print(min(mS))

Solution (Python):
s = str(input())
t = str(input())
ns = len(s)
nt = len(t)

ans = nt
for i in range(ns-nt+1):
    count=0
    for j in range(nt):
        if not s[i+j] == t[j]:
            count += 1
    ans = min(count,ans)

print(ans)

Solution (Python):

 
S = input()
T = input()

ans = len(T)
for i in range( len(S)-len(T)+1 ):
  count = len(T)
  for j in range( len(T) ):
    
    if( S[i+j]==T[j] ):
      count -= 1
  
  if( count < ans ):
    ans = count

print(ans)

Solution (Python):
s = list(input())
t = list(input())
m = len(t)
for i in range(len(s)-len(t)+1):
    c = 0
    target = s[i:i+len(t)]
    
    for j in range(len(t)):
        
        if not target[j] == t[j]:
            c += 1
    
    if c < m :
        m = c
print(m)

Solution (Python):
s, t = input(), input()
mn = 1000
for i in range(len(s)-len(t)+1):
    curr = 0
    for j in range(len(t)):
        curr += t[j] != s[i+j]
    mn = min(mn, curr)
print(mn)

Solution (Python):
s = str(input())
t = str(input())

slen = len(s)
tlen = len(t)

i = tlen
n = 0
a = 0


max_count = 0
while i <= slen:
    ps = s[ n : i + tlen -1 ]
    count = 0
    for j in range(tlen):
        if ps[j] == t[j]:
            count += 1



    if max_count < count:
        max_count = count
    n += 1
    i += 1
print(tlen - max_count)

Solution (Python):
def input_from_console():
    s = input()
    t = input()
    return s, t


def solve(s, t):
    min_count = len(t)
    for i in range(len(s)-len(t) + 1):
        temp_count = 0
        for j in range(len(t)):
            if s[j+i] != t[j]:
                temp_count += 1
        min_count = min(min_count, temp_count)
    return min_count


def main():
    s, t = input_from_console()
    print(solve(s, t))


if __name__ == "__main__":
    import sys

    if sys.gettrace():  
        check_cases()
    else:
        main()

Solution (Python):
S = input()
T = input()
s = len(S)
t = len(T)
M = 0
tmp = [ord(char) for char in T]
for n in range(s-t+1):
  m = [ord(char) - tmp[i] for i, char in enumerate(S[n:n+t])].count(0)
  if M < m:
    M = m
print(t-M)

Solution (Python):
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy


import heapq
sys.setrecursionlimit(10**6)

INF = 10**18
import bisect
import statistics
mod = 10**9+7


S = input()
T = input()

m = 0

def count(A, B):
    ans = 0
    for i in range(len(A)):
        if A[i] == B[i]:
            ans += 1
    return ans

for i in range(len(S)-len(T)+1):
    m = max(m, count(S[i:i+len(T)],T))

print(len(T)-m)

Solution (Python):
s = input()
t = input()
ans = 1000
for i in range(len(s)-len(t)+1):
    tmp = 0
    for j in range(len(t)):
        if s[i+j] != t[j]:
            tmp += 1
    ans = min(tmp, ans)
print(ans)

Solution (Python):
import sys
S = input()
T = input()

if T in S:
    print(0)
    sys.exit(0)

ans = []
for i in range(len(S)-len(T)+1):
    s = S[i:i+len(T)]
    cnt = 0
    for x, y in zip(s, T):
        if x == y:
            cnt += 1
    ans.append(cnt)
    
print(len(T)-max(ans))

Solution (Python):
s=str(input())
t=str(input())

sl=[]
tl=[]

for i in range(len(s)):
  sl.append(s[i])
for i in range(len(t)):
  tl.append(t[i])
  
m=100000
for i in range(len(s)-len(t)+1):
  cnt=0
  for j in range(len(t)):
    if t[j]!=s[i+j]:
      cnt+=1
  m=min(m,cnt)
print(m)

Solution (Python):
S = input()
T = input()
i = 0
min = len(T)

if(T in S):
    print("0")
else:
    while(i <= len(S)-len(T)):
        count = 0
        
        
        
        for j in range(len(T)):
            
            
            
            if(T[j] != S[j + i]):
                count+=1
        
        
        if(count <= min and count != 0):
            min = count
            
        i+=1
    print(min)

Solution (Python):



import sys
from collections import defaultdict, deque
from heapq import heappush, heappop
import math
import bisect
input = sys.stdin.readline




s = input()[:-1]
t = input()[:-1]
num = len(t)
ans = 1000

for i in range(len(s)-len(t)+1):
    val = 0
    for idx, t_ in enumerate(t):
        if s[i + idx] != t_:
            val += 1
    ans = min(ans, val)

print(ans)

Solution (Python):
s = input()
t = input()

m = 1001


for i in range(len(s)-len(t)+1):
  count = 0
  for j in range(len(t)):
    if(s[i+j]!=t[j]):
      count += 1
  m = min(m,count)
  
print(m)

Solution (Python):
s=input()
t=input()
 
result = 0
for i in range(len(s)):
  if len(s) < len(t) + i:
    break
  count = 0
  for j in range(len(t)):
    if t[j] == s[i+j]:
      count += 1
      
  result = max(result,count)
print(len(t)-result)

Solution (Python):
a = list(input())
b = list(input())
min_k = len(b)
for i in range(len(a)-len(b)+1):
  c = a[i:i+len(b)]
  count=0
  for k,j in enumerate(c):
    if b[k]==j:
      count+=1
        
  min_k = min(min_k,len(b)-count)

print(min_k)

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


sys.setrecursionlimit(10**7)






S = str(input())
T=str(input())
ans = 0
temp = 0


for i in range(len(S)):
    temp = 0
    for j in range(len(T)):
        if(len(S)<i+len(T)):
            break
        if(S[i+j]==T[j]):
            temp += 1
    ans = max(ans,temp)

print(len(T)-ans)

Solution (Python):
s=input()
t=input()
i,m=0,1e9
while(i+len(t)<=len(s)):
    c=0
    for j in range(len(t)):
        if(s[i+j]!=t[j]):
            c+=1
    m=min(m,c)
    i+=1
print(m)

Solution (Python):
s = input()
t = input()
res = []
for i in range(len(s)-len(t)+1):
    x = s[i:i+len(t)]
    count = sum(1 for a, b in zip(t, x) if a != b)
    res.append(count)

print(min(res))

Solution (Python):
s = input()
t = input()
x = len(t)
res= 0
for i in range(len(s) - x+1):
    tmp = s[i:i+x]
    cntmp = 0
    for j in range(x):
        if t[j] == tmp[j]:
            cntmp += 1
    res = max(res, cntmp)
print(x-res)

Solution (Python):
from sys import setrecursionlimit
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush
from time import time
import re
setrecursionlimit(10**9)
mod=10**9+7
inf=10**18

s=input()
t=input()
idx=0
wk=0
while 1:
    mt=0
    for idx2,val in enumerate(t):
        if s[idx+idx2]==val:
            mt+=1
    wk=max(wk,mt)
    if idx+len(t)>=len(s):break
    else:idx+=1
    
print(len(t)-wk)

Solution (Python):
s1 = input()
s2 = input()
a = len(s2)
m = 10**18
for x in range(len(s1)-a+1):
  s3 = s1[x:x+a]
  s = 0
  for y in range(a):
    if s3[y]!=s2[y]:
      s+=1
  m = min(m,s)
print(m)

Solution (Python):
from math import floor, ceil, sqrt, factorial, log, gcd
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
import copy
import numpy as np
import sys
INF = float('inf')
mod = 10**9+7


def lcm(a, b): return a * b / gcd(a, b)





def LI(): return list(map(int, sys.stdin.buffer.readline().split()))




def I(): return int(sys.stdin.buffer.readline())





def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()




def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')







def IR(n): return [I() for i in range(n)]







def LIR(n): return [LI() for i in range(n)]







def SR(n): return [S() for i in range(n)]







def LSR(n): return [LS() for i in range(n)]







def SRL(n): return [list(S()) for i in range(n)]


def main():
    s = list(S())
    t = list(S())
    lst = []
    ans = []
    for i in range(len(s) - len(t)+1):
        lst.append(s[i: i + len(t)])
    for l in lst:
        cnt = 0
        for i in range(len(t)):
            if l[i] == t[i]:
                cnt += 1
            ans.append(len(t) - cnt)
    print(min(ans))


if __name__ == "__main__":
    main()

Solution (Python):
s = input()
t = input()
x = len(t)
mx= 0

res= 0
for i in range(len(s) - x+1):
    
    tmp = s[i:i+x]
    cntmp = 0
    for j in range(x):
        if t[j] == tmp[j]:
            cntmp += 1
    
    res = max(res, cntmp)
print(x-res)

Solution (Python):
s= input()
t= input()
a = len(s)
b = len(t)
i = 0
j = 0
cnt = 0
ans = b
while(j <= a - b):
    while (i < b):
        if (s[i + j] != t[i]):
            cnt+=1
        i+=1
    ans = min(ans, cnt)
    cnt = 0
    i = 0
    j+=1
print(ans)

Solution (Python):
a = input()
b  =input()

m = len(a)
n = len(b)

ans = 10e9+7

for i in range(m-n+1):
	c=0;
	for j in range(n):
		if(a[i+j]!=b[j]):
			c+=1
	ans = min(c,ans)

print(ans)

Solution (Python):
def main():
    s_long = input()
    s_shor = input()

    ans = len(s_shor)
    max_len = len(s_long) - len(s_shor) + 1


    for i in range(max_len):
        cnt = 0

        for j in range(len(s_shor)):

            short = s_shor[j]
            longg = s_long[i + j]
            
            if (short != longg):
                cnt += 1
        
        ans = min(ans, cnt)
        
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
def main():
	s = str(input())
	t = str(input())
	
	
	if len(s) == len(t):
		ans = 0
		for i in range(len(t)):
			if list(s)[i] == list(t)[i]:
				ans += 1
		print(len(t)-ans)

	else:
		l = []
		for i in range(len(s)-len(t)):
			l.append(s[i:i+len(t)])
		
		ans = []
		for c in l:
			counter = 0
			for i in range(len(c)):
				if list(c)[i] == list(t)[i]:
					counter += 1
			ans.append(counter)

		if not ans:
			print(len(t))
		else:
			print(len(t)-max(ans))





	

if __name__ == '__main__':
	main()

Solution (Python):
S = input()
T = input()

ans = 10000
for i in range(len(S) - len(T) + 1):
    subset = S[i:i + len(T)]
    
    cnt = 0
    for s, t in zip(subset, T):
        
        if s != t:
            cnt += 1
    ans = min(ans, cnt)
print(ans)

Solution (Python):
s=list(input())
t=list(input())
ans=len(t)
for i in range(len(s)-len(t)+1):
    count=len(t)
    for j in range(len(t)):
        if s[i+j]==t[j]:
            count-=1
    if count<ans:
        ans=count
print(ans)

Solution (Python):
s=input()
t=input()
lt=len(t)
ls=len(s)
differ=ls-lt
ans=[]
for i in range(0,differ+1,1):
  cnt=0
  st=differ-i
  s_cont=s[st:]
  for a in range(lt):
    if s_cont[a]==t[a]:
      cnt+=1
    ans.append(lt-cnt)
print(min(ans))

Solution (Python):
import sys
input = sys.stdin.readline

S=input().strip()
T=input().strip()

max = 0
for i in range(len(S)-len(T)+1):
    hit = 0
    for j in range(len(T)):
        if T[j] == S[j+i]:
            hit += 1
    if hit > max:
        max = hit

print(len(T)-max)

Solution (Python):
s = input()
t = input()
char_1 = list(s)
char_2 = list(t)
count = 0
max_num = 0
for i in range(len(char_1)-len(char_2)+1):
    count = 0
    for j in range(len(char_2)):
        if(char_1[i+j]==char_2[j]):
            count += 1
    if(max_num<=count):
        max_num = count
        
print(len(char_2)-max_num)

Solution (Python):
S = input()
T = input()

lstS = list(S)
lstT = list(T)

difMin = 1000

for i in range(len(lstS)-len(lstT)+1):
  dif = 0
  
  for j in range(len(lstT)):
    if(lstT[j] != lstS[i+j]):
      dif += 1
  
  if(dif < difMin):
    difMin = dif

print(difMin)

Solution (Python):
S = input()
T = input()
C = []
if len(S) == len(T):
  c = 0
  for j in range(len(T)):
      if S[j] == T[j]:
        c += 1
  C.append(c)
else:
  for i in range(len(S) - len(T)+1):
    s = S[i:len(T)+i]
    c = 0
    for j in range(len(T)):
      if s[j] == T[j]:
        c += 1
    C.append(c)
print(len(T)-max(C))

Solution (Python):
S = input()
T = input()

ans = []

for i in range(len(S) - len(T) +1):
    count = 0
    for j, k in zip(T,S[i:i+len(T)]):
        if j == k:
            count += 1
    ans.append(count)
    
print(len(T) - max(ans))

Solution (Python):
s = str(input())
t = str(input())
lens = int(len(s))
lent = int(len(t))
icchi = []
c = 0
for i in range(lens-lent+1):
    scut = s[i:lent+i]
    for j in range(lent):
        if scut[j] == t[j]:
            c += 1
    icchi.append(c)
    c=0
print(lent-max(icchi))

Solution (Python):
s=input()
t=input()
n=len(s)
l=len(t)
count=l
for j in range(n-l+1):
    sj=s[j:j+l]
    res=0
    for k in range(l):
        if sj[k]!=t[k]:
            res+=1
    if res<count:
        count=res



print(count)

Solution (Python):
import sys

s = input()
t = input()
a = len(s)
b = len(t)
c = sys.maxsize
for i in range(a - b + 1):
    d = 0
    for k in range(b):
        if t[k] != s[i+k]:
            d += 1
    c = min(d, c)
print(c)

Solution (Python):
S = str(input())
T = str(input())
tempcount = 0
mincount = 0

for i in range(len(S) - len(T)+1):
    for j in range(len(T)):
        if S[i + j] != T[j]:
            tempcount += 1
    if i == 0:
        mincount = tempcount
    elif tempcount < mincount:
        mincount = tempcount
    tempcount = 0
    
print(mincount)

Solution (Python):
S = input().strip() ;
T = input().strip() ;


c = len(T) ;
for idx in range ( len ( S ) ) :
	if idx+len(T) >len(S) : break ;
	S2 = S[idx:idx+len(T)] ;
	
	x = 0 ;
	for c1  ,c2  in zip ( S2 , T ) :
		if c1 != c2 :
			x += 1; 
	c = min ( x  ,c ) ; 
print ( c ) ;

Solution (Python):
import numpy as np
import sys

S = input()
T = input()

counter = 0
max_counter = 0

for i in range(len(S) - len(T) + 1):
    for j in range(len(T)):
        if S[j+i] == T[j]:
            counter = counter + 1
    if counter > max_counter:
        max_counter = counter
    
    
    counter = 0

print(int(len(T)) - int(max_counter))

Solution (Python):
s = input()
t = input()

def check(l, r):
    res = 0
    for i, j in zip(l, r):
        if i != j:
            res += 1
    return res
ans = float("inf")
for i in range(len(s)-len(t)+1):
    ans = min(ans, check(s[i:len(t)+i], t))
print(ans)

Solution (Python):
S = input()
T = input()
S = [i for i in S]
T = [i for i in T]
Cnt = []
for i in range(len(S)-len(T)+1):
    cnt = 0
    for j in range(len(T)):
        if S[i+j]!=T[j]:
            cnt += 1
    Cnt.append(cnt)
Cnt.sort()
print(Cnt[0])

Solution (Python):
s=input()
t=input()
ans = 0
c = 0
m = 1001

for i in range(len(s)-len(t)+1):
    tmp = s[i:i+len(t)]
    
    for j in range(len(t)):
        
        if tmp[j] != t[j]:
            c+=1
        
    if m > c:
        m = c
        ans = c
    c=0

print(ans)

Solution (Python):
import numpy as np
max_change = 1000
s = input()
t = input()
list_t = np.array([ _ for _ in t])
if len(s) == len(t):
    list_s = np.array([ _ for _ in s])
    list_tf = list_t == list_s
    n_change = len(list_t) - sum(list_tf)
    if n_change < max_change:
        max_change = n_change
    else:
        pass
else:
    for i in range(1,len(s) - len(t) + 1):
        s_sample = s[i-1:len(t)+i-1]
        list_ss = np.array([ _ for _ in s_sample])
        list_tf = list_t == list_ss
        n_change = len(list_t) - sum(list_tf)
        if n_change < max_change:
            max_change = n_change
        else:
            pass
print(max_change)

Solution (Python):


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

S = input()
T = input()

lis = list(T)

max_count = 0
for i in range(len(S) - len(T)+1):
    subS = list(S[i:i+len(T)])
    count = 0
    for j in range(len(T)):
        if subS[j] == T[j]:
            count += 1
    
    max_count = max(max_count, count)

print(len(T) - max_count)

Solution (Python):
s=list(input())
t=list(input())
n=len(t)
max_num=0
for i in range(0,len(s)-n+1):
  num=0
  for j in range(n):
    if t[j]==s[i+j]:num+=1
  max_num=max(max_num, num)
print(max(0,n-max_num))

Solution (Python):
S = input()
T = input()

index = 0
tmp = 0
ans = float('inf')

loop_time = len(S) - len(T) + 1
T_len = len(T)
for i in range(loop_time):
    S_new = S[i:T_len+i]
    tmp = T_len
    for s,t in zip(S_new,T):
        if s == t:
            tmp -= 1
    ans = min(ans,tmp)
print(ans)

Solution (Python):
s=str(input())
l=len(s)
t=str(input())
n=len(t)
ans=n
sum=0
for i in range(l+1-n):
    cutted=s[i:i+n]
    for j in range(n):
        if cutted[j]==t[j]:
            continue
        else:
            sum+=1
    ans=min(ans,sum)
    sum=0
print(ans)

Solution (Python):
def main():
    s = input()
    t = input()
    len_s = len(s)
    len_t = len(t)

    min_count = len_t
    for i in range(len_s-len_t+1):
        count = len_t
        for j in range(len_t):
            if s[i+j] == t[j]:
                count -= 1
        if count < min_count:
            min_count = count
    return min_count


if __name__ == "__main__":
    print(main())

Solution (Python):
s = input()
t = input()
y = 1001
for i in range(len(s) - len(t) + 1): 
    x = 0
    for j in range(len(t)): 
        if s[i + j] != t[j]:
            x += 1
    if x < y:
        y = x
print(y)

Solution (Python):
s = input()
t = input()
ans = 100000
for i in range(len(s) - len(t) + 1):
    lt = len(t)
    cnt = 0
    for a, b in zip(s[i:i+lt], t):
        if a != b:
            cnt += 1
    ans = min(ans, cnt)
print(ans)

Solution (Python):
s = input()
t = input()

ans = 100000
for start in range(len(s)-len(t)+1):
    substr = s[start:start+len(t)]

    cnt = len(t)
    for i in range(len(substr)):
        if t[i] == substr[i]:
            cnt -= 1
    ans = min(ans, cnt)

print(ans)

Solution (Python):
s = input()
t = input()

num = 0;
cnt = 0
min = len(t)
for i in range(len(s)-len(t)+1):
    ss = s[num:num+len(t)]
    for x,y in zip(ss,t):
        if x != y:
            cnt += 1
    if cnt < min:
        min = cnt
    cnt = 0
    num = num +1

print(min)

Solution (Python):
S = input()
T = input()
ls = len(S)
lt = len(T)

m = 0
for i in range(ls-lt + 1):
    x = 0
    for j in range(lt):
        if S[j + i] == T[j]:
            x += 1
    m = max(x, m)
print(lt - m)

Solution (Python):
S=input()
S1=list(S)
T=input()
T1=list(T)
ans=[]
for i in range(len(S1)-len(T1)+1):
  d=len(T1)
  for j in range(len(T1)):
    if T1[j]==S1[j+i]:
      d-=1
  ans.append(d)
an=min(ans)
print(an)

Solution (Python):
s = str(input())
t = str(input())
cnt = 0
max = 0
for i in range(len(s)-len(t)+1):
  cnt = 0
  for j in range(len(t)):
    if s[j+i] == t[j]:
      cnt += 1
  if max < cnt:
    max = cnt
            
print(len(t)-max)

Solution (Python):
def main():
    s_long = input()
    s_shor = input()

    ans = len(s_shor)
    max_len = len(s_long) - len(s_shor) + 1


    for i in range(max_len):
        cnt = 0

        for j in range(len(s_shor)):

            short = s_shor[j]
            longg = s_long[i + j]
            
            if (short != longg):
                cnt += 1
        
        ans = min(ans, cnt)
        
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
S = input()
T = input()
maxCount = len(T)
for i in range(len(S)-len(T)+1):
    countNotEqual = 0
    for j in range(len(T)):
        if S[j+i] != T[j]:
            countNotEqual += 1
    if countNotEqual < maxCount:
        maxCount = countNotEqual
print(maxCount)

Solution (Python):
s = list(input())
t = list(input())

s_num = len(s)
t_num = len(t)

max_count = 0
for i in range(s_num - t_num + 1):
    count = 0
    for j in range(t_num):
        if s[i + j] == t[j]:
            count += 1
    if count > max_count:
        max_count = count

print(t_num - max_count)

Solution (Python):
s = input()
t = input()
ans = len(t)

for i in range(len(s)-len(t)+1):
  ss = s[i:i+len(t)]
  count = 0
  for x,y in zip(t, ss):
    if x==y:
      count += 1
    ans = min(ans, len(t)-count)
  
print(ans)

Solution (Python):
parentalString = list(input())
childString = list(input())
numOfDiffs = []

for i in range(0,(len(parentalString) - len(childString))+1):
  count = 0
  for k in range(0,len(childString)):
    if childString[k] != parentalString[i+k]:
      count = count + 1
  numOfDiffs.append(count)

print(min(numOfDiffs))

Solution (Python):
s1 = input()
s2 = input()

list_s1 = list(s1)
list_s2 = list(s2)

len_s1 = len(s1)
len_s2 = len(s2)

change_count_min = len_s2

for i in range(len_s1 - len_s2 + 1):
    change_count = len_s2
    for j in range(len_s2):
        if list_s1[j+i] == list_s2[j]:
            change_count -= 1

    if change_count < change_count_min:
        change_count_min = change_count
print(change_count_min)

Solution (Python):
S = str(input())
T = str(input())


ans = len(T)
for i in range(0,len(S)-len(T)+1):
  
  count = 0

  for j in range(0,len(T)):
    
    if S[i+j] == T[j]:
      count = count + 1
    else:
      count = count
  
  tmp = len(T)-count
  
  if ans > tmp:
    ans = tmp
  else:
    ans = ans

print(ans)

Solution (Python):
S = str(input())
T = str(input())
ans = 10000
for i in range(len(S)-len(T)+1):
    c = S[i:] 
    cnt = 0
    for j in range(len(T)):
        if str(T[j]) != str(c[j]):
            cnt += 1
    if cnt == 0:
        ans = cnt
    elif  ans > cnt:
        ans = cnt
print (ans)

Solution (Python):
S = input()
T = input()

min = len(T)

for index in range( len(S)-len(T)+1 ):
  temp = 0
  for index2 in range(len(T)):
    if T[index2] != S[index+index2]:
      temp += 1
  if temp < min:
    min = temp

print(min)

Solution (Python):
S = input()
T = input()

change_num = 1000000000
count = 0

for i in range(len(S)):
    if (len(T) + i) > len(S):
        break

    s = S[i:len(T) + i]
    for j, k in enumerate(s):
        if k != T[j]:
            count += 1

    if count < change_num:
        change_num = count

    count = 0


print(change_num)

Solution (Python):
S = input()
T = input()
value = 10000
score = 0

for x in range(len(S)):
  S_cut = S[x:x+len(T)]
  if len(S_cut) < len(T):
    break
  else:
    score = 0
    for y in range(len(T)):     
      if S_cut[y] != T[y]:
        score += 1
      else:
        continue
  if score < value:
        value = score
print(value)

Solution (Python):
S = input()
T = input()
res = len(T)
for i in range(len(S) - len(T) + 1):
    cnt = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            cnt = cnt + 1
    res = min(res, cnt)
print(res)

Solution (Python):
S = input()
T = input()

cntMIN = float("inf")
for s in range(len(S)):
    if s + len(T) - 1 > len(S) - 1:
        break

    cnt = 0
    for i in range(len(T)):
        if S[s + i] != T[i]:
            cnt += 1
    
    cntMIN = min(cnt, cntMIN)

print(cntMIN)

Solution (Python):
s = input()
t = input()

l_s = len(s)
l_t = len(t)

res = l_t
for i in range(l_s - l_t + 1):
    cnt = 0
    for j in range(l_t):
        if t[j] != s[i+j]:
            cnt+=1
    if res > cnt:
        res = cnt
print(res)

Solution (Python):
S=input()
T=input()
ans=0
if S==T: print(0); exit()
for i in range(len(S)-len(T)+1):
    tmp = 0
    for j in range(len(T)):
        if S[i+j] == T[j]:
            tmp += 1
    ans = max(ans, tmp)
if not len(S) == ans:
  ans = len(T) - ans
print(ans)

Solution (Python):
import numpy as np
from copy import deepcopy
from heapq import heappop, heappush
from bisect import bisect_left, bisect
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations

S = input()
T = input()

m = len(T)

for i in range(len(S) - len(T) + 1):
    c = 0

    for j in range(len(T)):
        if (S[i + j] != T[j]):
            c += 1

    m = min(c, m)

print(m)
exit()

Solution (Python):
from collections import deque

def main():
    import sys
    input = sys.stdin.readline

    S = input()
    T = input()

    len_S = len(S)-1
    len_T = len(T)-1
    
    
    
    
    ans = 0
    for i in range(len_S - len_T +1):
        cnt = len_T
        for j in range(len_T):
            
            
            
            if(S[i+j] != T[j]):
                cnt -= 1
        
        
        ans = max(ans, cnt)
    print(len_T-ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    ans = 10000
    s = input().rstrip('\n')
    t = input().rstrip('\n')
    lent = len(t)
    lens = len(s)
    tmp = 0
    for i in range(lens-lent+1):
        tmp = 0
        for j in range(lent):
            if s[i:i+lent][j] != t[j]:
                tmp += 1
        ans = min(ans, tmp)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
s = input()
t = input()

if (t in s):
    print(0)
    sys.exit()

ans = 1000
for i in range(len(s)-len(t)+1):
    diff = 0
    for j in range(len(t)):
        if (s[i+j] == t[j]):
            pass
        else:
            diff += 1
    
    ans = min(ans, diff)

print(ans)

Solution (Python):

S = list(input())
T = list(input())
min0 = len(T)
min = len(T)

for i in range(len(S) - len(T) + 1):
  c = 0
  for j in range(len(T)):
    if S[i + j] == T[j]:
      c += 1
  if (min0 - c) < min:
    min = min0 - c

print(min)

Solution (Python):
s=str(input())
t=str(input())
n=len(s)-len(t)
cl=[]
for i in range(n+1):
    cnt=0
    for j in range(len(t)):
        if s[j+i]==t[j]:
            cnt+=1
    cl.append(cnt)
print(len(t)-max(cl))

Solution (Python):
s = input()
t = input()

def count_ans(a,b):
    ans = 0
    for c1,c2 in zip(a, b):
        if c1 == c2:
            ans += 1
    return ans

ans = 0
for i in range(len(s)-len(t)+1):
    ans_ = count_ans(s[i:i+len(t)],t)
    if ans < ans_:
        ans = ans_

print(len(t)-ans)

Solution (Python):
from sys import stdin


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    S = _in[0]  
    T = _in[1]  
    
    ans = float('inf')
    S_ = list(S)
    T_ = list(T)

    for i in range(len(S_)-len(T_)+1):
        s_ = S_[i:i+len(T_)]
        cnt = 0
        for a,b in zip(s_, T_):
            if a == b:
                pass
            else:
                cnt += 1
        ans = min(ans, cnt)
    
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
s=input()
t=input()
a=len(s)
b=len(t)
C=0
for i in range(a-b+1):
    count=0
    for j in range(b):
        if s[i+j]==t[j]:
            count+=1
    C=max(C,count)
print(b-C)

Solution (Python):
s = input()
t = input()
ls = len(s)
lt = len(t)
mx = 0
for i in range(ls -lt + 1):

  c = 0
  for j in range(lt):

    if s[i+j] == t[j]:
      c+= 1
  if c > mx:
    mx = c
print(lt - mx)

Solution (Python):
from sys import stdin

s = stdin.readline().strip()
t = stdin.readline().strip()

def lev(t1, t2):
  cnt = 0
  for i in range(len(t1)):
    if t1[i] == t2[i]:
      cnt += 1
  return len(t1) - cnt

min_val = 9999
for i in range(len(s)-len(t)+1): 
  l = lev(t, s[i:i+len(t)])
  if l < min_val:
    min_val = l

print(min_val)

Solution (Python):
s = list(input())
t = list(input())
l = list()
wake = len(s)-(len(t)-1)

for i in range(wake):
  l.append(s[i:i+len(t)])
gokei = len(t)
for i in l:
  sco = len(t)
  q = 0
  for j in i:
    if j == t[q]:
      sco -= 1
    q += 1
  if gokei > sco:
    gokei = sco
    
print(gokei)

Solution (Python):
S = str(input())
T = str(input())

max_len = 0
for i in range(len(S) - len(T) + 1):
    tmpS = S[i: i + len(T)]
    tmp_cnt = 0
    for j in range(len(T)):
        if tmpS[j] == T[j]:
            tmp_cnt += 1
    max_len = max(tmp_cnt, max_len)

print(len(T) - max_len)

Solution (Python):

s=input()
t=input()
ans=10000
lt=len(t)
ls=(len(s))
start,last=0,lt
while last<=ls:
    count=0
    j=0
    for i in range (start,last):
        if s[i]!=t[j]:
            count+=1
        j+=1
    ans=min(ans,count)
    start+=1
    last+=1


print(ans)

Solution (Python):
s = input()
t = input()
N = len(s)
n = len(t)
m = 0
T = list(t)
S = list(s)
if N == n:
    for i in range(n):
        if T[i] == S[i]:
            m += 1
else:
    for i in range(N-n):
        cnt = 0
        for j in range(n):
            if S[i+j] == T[j]:
                cnt += 1
        if m < cnt:
            m = cnt
print(n-m)

Solution (Python):
import sys
def main():
    S = list(input())
    T = list(input())

    substrings = []
    for i in range(0, len(S) - len(T) + 1):
        substrings.append(S[i:i+(len(T))])

    ans = sys.maxsize
    for string in substrings:
        count = 0
        for i in range(len(T)):

            if string[i] == T[i]:
                count += 1

        

        ans = min(len(T)-count, ans)

    print(ans)



main()