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()

ls = len(s)
lt = len(t)

ans = 9999999
for i in range(ls-lt+1):

    tmp = 0
    for j in range(lt):
        if(s[i+j] != t[j]):tmp+=1
    ans = min(ans, tmp)
print(ans)

Solution (Python):
s=input()
t=input()
lens=len(s)
lent=len(t)

mxcnt=0
for i in range(lens-lent+1):
  cnt=0
  for j in range(lent):
    if  s[i+j]==t[j]:
      cnt+=1
      mxcnt=max(mxcnt,cnt)
print(lent-mxcnt)

Solution (Python):
S = input()
T = input()
s = len(S)
t = len(T)

count = 0
max = 0

for i in range(s-t+1):
  for j in range(t):
    if S[i+j] == T[j]:
      count += 1
  if count > max:
    max = count
    count = 0
  else:
    count = 0

print(t-max)

Solution (Python):
def solve():
    s = input()
    t = input()
    s_l, t_l = len(s), len(t)
    e = [s[i:i+s_l] for i in range(0, s_l-t_l+1)]
    ans = min([sum(i != j for i, j in zip(k, t)) for k in e])
    print(ans)


def main():
    t = 1
    while t > 0:
        solve()
        t -= 1


main()

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

num = len(s) - len(t) + 1

ans = []
for i in range(num):
  counter = 0
  for j in range(len(t)):
    if t[j] == s[j+i]:
      counter += 1
  ans.append(counter)
  
print(len(t) - max(ans))

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

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

m=[]

for i in range(0,l_s-l_t+1):
    s_b=s[i:i+l_t]
    x=0
    for j in range(0,l_t):
        if t[j]!=s_b[j]:
            x+=1
        else:
            continue
    m.append(x)
    
print(min(m))

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

n = len(T)
m = len(S)
L = []
R = []
for i in range(m-n+1):
    L.append(S[i:i+n:1])
count = 0
for word in L:
    for i in range(len(word)):
        if word[i] == T[i]:
            count += 1
    R.append(count)
    count = 0
print(n - max(R))

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


o = []
for i in range(0, (len(s) - len(t) + 1)):
    num = 0
    for j in range(len(t)):
        
        if t[j] != s[i + j]:
            num += 1
    o.append(num)


o = min(o)
print(o)

Solution (Python):
s = input()
t = input()
if len(s) == len(t):
  a = 0
  for i in range(len(t)):
    if s[i] == t[i]:
      a+=1
  print(len(s)-a)
  exit(0)
g = []
for i in range(len(s)-len(t)):
  n = 0
  for j in range(len(t)):
    if s[i+j]==t[j]:
      n+=1
  g.append(len(t)-n)
print(min(g))

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

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

print(ans)

Solution (Python):
import numpy as np
S = input()
T = input()
B = np.zeros(len(S) - len(T) + 1)
for i in range(len(S) - len(T) + 1):
  a = 0
  for j in range(len(T)):
    if S[i + j] != T[j]:
      a +=1
  B[i] = a
print(int(min(B)))

Solution (Python):

def solve():
    s=input()
    t=input()
    ans=len(t)
    for i in range(0,len(s)-len(t)+1) :
        diff=0
        for j in range(0,len(t)) :
            diff+= 1 if s[i+j]!=t[j] else 0
            if diff>ans :
                break
        ans=min(ans,diff)
    return ans

print(solve())

Solution (Python):
import sys 

string1 = str(input())
string2 = str(input())

n, m = len(string2), len(string1) 

ans = sys.maxsize 
for i in range(m - n + 1): 
    minRemovedChar = 0 
    for j in range(n): 
        if (string2[j] != string1[i + j]): 
            minRemovedChar += 1
    ans = min(minRemovedChar, ans) 

print(ans)

Solution (Python):



def main():
    s = input()
    t = input()
    lt = len(t)
    ans = lt
    for i in range(0, len(s) - lt + 1):
        sub = s[i : i + lt]
        c = 0
        for j in range(0, lt):
            if sub[j] != t[j]:
                c += 1
        if ans > c:
            ans = c
    print(ans)


if __name__ == "__main__":
    main()

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

values = [[] for a in range(len(T))]
for i, s in enumerate(S):
    for n, v in enumerate(T):
        if v == s:
            values[n].append(i)

maxR = 0
for ni, val in enumerate(values):
    current_i = 1 + ni
    for i in val:
        if i < ni or len(S) - (i+1) < len(T) - (ni+1):
            continue
        current = 1
        for j in range(len(T) - current_i):
            s_index = i + j + 1
            if s_index >= len(S):
                break
            if S[s_index] == T[j+current_i]:
                current += 1
        maxR = max(current, maxR)

print(len(T) - maxR)

Solution (Python):
def main():
    import copy
    S = str(input())
    T = str(input())
    ans = 0
    temp = 0

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

    ans = len(T) - temp
    
    
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
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 MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7

s = S()
t = S()

ls = len(s)
lt = len(t)
n_try = ls - lt + 1

ans = lt

for i in range(n_try):
    st = s[i:lt+i]
    buf = 0
    for j in range(lt):
        if st[j] !=  t[j]:
            buf += 1
    ans = min(ans, buf)

print(ans)

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

if t in s:
    print(0)
else:
    s = list(s)
    t = list(t)

    l_t = len(t)
    l_s = len(s)
    count = [0] * (l_s - l_t + 1)
    for i in range(l_s - l_t + 1):
        s_list = s[i:i+l_t]
        for j in range(len(t)):
            if t[j] == s_list[j]:
                count[i] += 1
    
    
    print(len(t) - max(count))

Solution (Python):
def kazu(S,T):
  s = len(S)
  t = len(T)
  anss = []
  for j in range(s - t + 1):
    ans = 0
    U = S[j:j+t]
    for k in range(t):
      if U[k] == T[k]:
        ans += 1
    anss.append(ans)
  print(t-max(anss))
  

S = input()
T = input()
kazu(S,T)

Solution (Python):
S = input()
T = input()
mm = 0
for i in range(len(S)-len(T)+1):
    a = S[i:i+len(T)]
    mm_now = sum([x == y for x,y in [*zip(a,T)]])
    mm = max(mm_now, mm)
print(len(T) - mm)

Solution (Python):
S = list(input())
T = list(input())
sl = len(S)
tl = len(T)

list1 = []
for i in range(sl-tl+1):
  count = 0
  x = list(zip (T,S[i:(i+tl)]))
 
  for j in range(tl):
    if x[j][0] == x[j][1]:
      count += 1
    list1.append(count)

print(tl - max(list1))

Solution (Python):
s = input()
t = input()
ans = 0
A = []
for i in range(len(s)-len(t)+1):
    s_i = s[i:i+len(t)+1]
    count = 0
    for j in range(len(t)):
        if s_i[j] == t[j]:
            count += 1
    A.append(count)

ans = len(t) - max(A)
print(ans)

Solution (Python):
s=input()
t = input()
min =(len(t))
for i in range(len(s)-len(t)+1):
    count = 0
    for ii in range(len(t)):
        if s[i+ii]!=t[ii]:
            count +=1
    if count <min:
        min = count
print(min)

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

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
from bisect import bisect_left


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

def bindex(a,x):
    i = bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return i
    return None

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    S = input()
    T = input()

    i = 0
    ans = INF
    while i < len(S)-len(T)+1:
        j, cnt = i, 0
        for t in T:
            s = S[j]
            if t == s:
                cnt += 1
            j += 1
        if cnt == len(T):
            
            print(0)
            exit()
        ans = min(ans, len(T)-cnt)
        i += 1
    print(ans)

Solution (Python):
def solve(a,b):
    cnt=0
    for x in range(len(a)):
        if a[x]!=b[x]:
            cnt+=1
    return cnt        
s=input()
t=input()
k=len(t)
ans=k
for x in range(len(s)-len(t)+1):
    ans=min(ans,solve(s[x:x+k],t))
print(ans)

Solution (Python):
S,T = input(),input()
ans = len(T)

for i in range(len(S)-len(T)+1):
    sum = 0
    for j in range(len(T)):
        if S[i+j] == T[j]:sum+=1
        
    ans = min(ans,len(T)-sum)
print(ans)

Solution (Python):
s = input()
t = input()
min_num = len(t)
tbd = 0
for i in range(0,len(s)-len(t)+1):
    for j in range(len(t)):
        if s[i:i+len(t)][j] != t[j]:
            tbd += 1
    if tbd <= min_num:
        min_num = tbd
    tbd = 0

print(min_num)

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

Solution (Python):
def match_num(s, part_s):
    match = 0
    for (s_char, part_s_char) in zip(s, part_s):
        if s_char == part_s_char:
            match += 1

    return match


s = input()
t = input()

max_match = 0

for i in range(len(s)):
    if i+len(t) > len(s):
        break
    part_s = s[i:i+len(t)]
    match = match_num(t, part_s)
    if match > max_match:
        max_match = match

print(len(t)-max_match)

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

count = []
for i in range(len(S) - len(T) + 1):
    match_count = 0
    for s, t in zip(S[i:i+len(T)], T):
        if s in t:
            match_count += 1
    count.append(match_count)

print(len(T) - max(count))

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




start_idx = 0
fix_words = 0
for i in range(len(T) - 1, len(S)):
  part = S[start_idx:i + 1]
  
  
  tmp_fix_words = 0
  for q in range(len(part)):
    if part[q] == T[q]:
      tmp_fix_words += 1
  
  fix_words = max(tmp_fix_words, fix_words)
  
  
  start_idx += 1
  
print(len(T) - fix_words)

Solution (Python):
def main():
    S = input()
    T = input()
    minv = len(T)
    cnt = 0
    if T in S:
        print(0)
        exit()
    else:
        for i in range(len(S)-len(T)+1):
            for s, t in zip(S[i:len(T)+i], T):
                if s != t:
                    cnt += 1
            minv = min(minv, cnt)
            cnt = 0
    print(minv)

if __name__ == '__main__':
    main()

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

res = len(T)

for i in range(len(S)-len(T)+1):
    count = 0
    for j, t in enumerate(T):
        if S[i+j] != t:
            count += 1
    if count < res:
        res = count

print(res)

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

ans = 10000000000000
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
    ans = min(cnt, ans)

print(ans)

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

s_length = len(s)
t_length = len(t)

ans = 1000

if s_length != t_length:
  for i in range(s_length - t_length):
    diff = 0
    parts = s[i:t_length+i]
    for j in range(t_length):
      if parts[j] != t[j]:
        diff += 1
    if ans > diff:
      ans = diff
else:
  ans = 0
  for j in range(t_length):
    if s[j] != t[j]:
      ans += 1

print(ans)

Solution (Python):
S = input()
T = input() 
ans = 1000
d = len(S) - len(T)
for i in range(d+1):
    s = S[i:i + len(T)]
    t = T
    a = 0
    
    for j in range(len(T)):
        if not(s[j] == t[j]):
            a+=1
    if  a <ans:
        ans = a
print(ans)

Solution (Python):
import sys

def main():

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

if __name__ == "__main__":
    main()

Solution (Python):
S = input()
T = input()
assert 1 <= len(S) and len(S) <= 1000
assert 1 <= len(T) and len(T) <= 1000
assert len(T) <= len(S)
for s in S:
    assert s.islower()
for t in T:
    assert t.islower()
len_T = len(T)
max_count = 0
for i in range(len(S)-len_T+1):
    count = 0
    for j in range(len_T):
        count += int(T[j] == S[i+j]) 
    max_count = max(count, max_count)
print(len_T - max_count)

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

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

else:
    countbox=[]
    for n in range(len(S)-len(T)+1):
        count =0
        for i in range(len(T)):
            if T[i] != S[i+n]:
                count+=1
        countbox.append(count)
    print(min(countbox))

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

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

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

max_same = 0
ans = 0

for i in range(0,len(s)-len(t)+1):
        for j in range(0,len(t)):
                if s[i+j] == t[j] :
                            max_same += 1
        ans = max(ans, max_same)
        max_same = 0

print(len(t)-ans)

Solution (Python):
S = input()
T = input()
lens = len(S)
lent = len(T)
result = lent
cnt = 0

for i in range(0,lens-lent+1):
    for j in range(0,lent):
        if S[i+j] != T[j]:
            cnt = cnt + 1
    if result > cnt:
        result = cnt
    cnt = 0

print(result)

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

mxscore = -1
beststr = ''
for i in range(len(s),len(t)+1):
    check = t[i-len(s):i]
    now = 0
    for j in range(len(check)):
        if s[j] == check[j]:
            now += 1
    if now > mxscore:
        mxscore = now

print(len(s)-mxscore)

Solution (Python):
S = input()
T = input()
a = []
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
    a.append(count)
print(min(a))

Solution (Python):
s=list(input())
t=list(input())
ans=[]

for i in range(len(s)-len(t)+1):
    u=s[i:len(t)+i]
    a=0
    for j in range(len(t)):
        if not t[j-1]==u[j-1]:
            a=a+1
    ans.append(a)
print(min(ans))

Solution (Python):
import difflib
import math

S = input()
T = input()

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


print(len(T) - same)

Solution (Python):
S=input()
T=input()
lenS=len(S)
lenT=len(T)
lendiff=lenS-lenT
ans=lenT
for i in range(lendiff+1):
    cost=lenT
    for j in range(lenT):
        if T[j]==S[i+j]:
            cost-=1
    ans=min(ans,cost)
print(ans)

Solution (Python):
s = input()
t = input()
n = len(t)
sl = len(s)
mmax= 0
for i in range(sl):
    cnt=0
    for y in range(n):
        
        if i+y>=sl:
            cnt=0
            break
        if s[i+y]==t[y]:
            cnt+=1
    mmax = max(mmax,cnt)
print(n-mmax)

Solution (Python):
def matchCount(str1, str2):
  r = len(str1)
  for idx in range(0, len(str1)):
    if str1[idx] == str2[idx]:
      r -= 1
  return r

s=input()
t=input()
slength = len(s)
tlength = len(t)
r = slength

for idx in range(0, slength - tlength + 1):
  ss = s[idx:idx + tlength]
  rr = matchCount(ss,t)
  if rr < r:
    r = rr
print(r)

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

ans = []


for i in range(len(S)-len(T)+1):
    diff = 0
    for j in range(len(T)):
        if S[i:i+len(T)][j] == T[j]:
            pass
        else:
            diff += 1
    ans.append(diff)
    

print(min(ans))

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

cand = []
for start in range(len(S) - len(T) + 1):
    cnt = sum([not T[i] == S[start:start+len(T)][i] for i in range(len(T))])
    cand.append(cnt)

print(min(cand))

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

print(min(l))

Solution (Python):
S,T=open(0).read().split()
n=len(T)
def diff(a,b):
    d=0
    for i in range(n):
        if a[i]!=b[i]:
            d+=1
    return d
dmin=1000
for i in range(len(S)-n+1):
    dmin=min(dmin,diff(S[i:],T))
print(dmin)

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()
t = input()

ans = 10**5

len_s = len(s)
len_t = len(t)

S = []

for i in range(len_s):
    S.append(s[i])

for i in range(len_s - len_t+1):
    tmp = 0
    ss = S[i:i+len_t]
    for j in range(len_t):
        if t[j] != ss[j]:
            tmp += 1
    if tmp < ans:
        ans = tmp

print(ans)

Solution (Python):
s=input()
t=input()
ls=len(s)
lt=len(t)
ans=0
for i in range(ls-lt+1):
  k=0
  for j in range(lt):
    if s[i+j]==t[j]:k+=1
  ans=max(ans,k)
print(lt-ans)

Solution (Python):
import sys
s=input()
t=input()
n=10**5
k=0
h=[]
for i in range(len(s)-len(t)+1):
    h=s[i:i+len(t)]
    l=0
    for j in range(len(t)):
        if h[j]!=t[j]:
            l+=1
    n=min(n,l)
print(n)

Solution (Python):
S= input()
T= input()
s=len(S)
t=len(T)
a=0
for i in range(s-t+1):
    cnt=0
    for j in range(t):
        if S[i+j]==T[j]:
            cnt=cnt+1
    if cnt>a:
        a=cnt
print(t-a)

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

Solution (Python):
S = str(input())
T = str(input())
count = 0
max_count = 0

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

Solution (Python):
import sys
s = input()
t = input()
ans = 0
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
    ans = max(ans,cnt)
print(len(t)-ans)

Solution (Python):
s=input()
t=input()
s=list(s)
t=list(t)
d=[]
c=0
if len(s)==len(t):
    for j in range(len(t)):
        if s[j]!=t[j]:
            c+=1
    d.append(c)
else:
    for i in range(len(s)-len(t)):
        c=0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                c+=1
        d.append(c)
print(min(d))

Solution (Python):
s = input()
t = input()
u = t
ans =0
count=0
maxans=0
if len(s) == len(t):
    for j in range(len(t)):
        if s[j] == t[j]:
            count+=1
    maxans = count
else:
    for i in range(len(s)-len(t)):
        count =0
        for j in range(len(t)):
            if s[j+i] == t[j]:
                count+=1
        maxans = max(maxans, count)

print(len(t)-maxans)

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

Solution (Python):
s=input()
t=input()
ans=1000000000
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
    if cnt<ans:
        ans=cnt
print(ans)

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

s = ''.join(s)
t = ''.join(t)


count = 0
maxcount = 0
slen = len(s)
tlen = len(t)
j = 0

while j <= slen-tlen:
    k = j
    for i in range(tlen):
        if t[i] == s[k]:
            count += 1
        k+= 1
    j += 1
    if count > maxcount :
        maxcount = count
    count = 0
print(len(t)-maxcount)

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

maxi = 0

for i in range(0, len(s)-len(t)+1):
    temp = 0
    for j in range(len(t)):
        if s[i+j] == t[j]:
            temp += 1
    maxi = max(temp, maxi)

print(len(t) - maxi)

Solution (Python):
def main():
    S = input()
    T = input()
    answer = solve(S, T)
    print(answer)


def solve(S, T):
    min_diff_cnt = len(T)
    for i in range(len(S) - len(T) + 1):
        s = S[i:i+len(T)]
        diff = [(x, y) for x, y in zip(list(s), list(T)) if x != y]
        diff_cnt = len(diff)
        if diff_cnt < min_diff_cnt:
            min_diff_cnt = diff_cnt

    return min_diff_cnt

if __name__ == "__main__":
    main()

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

for i in range(len(S)-len(T)+1):
  s = S[i:i+len(T)]
  tmp = 0
  for j in range(len(T)):
    if s[j] != T[j]:
      tmp += 1
  ans = min(ans, tmp)
  
print(ans)

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

chageCountMin = len(T)

for i,_ in enumerate(S[:len(S) if len(T) == 1 else -len(T) + 1:]):
	changeCount = 0
	for j,_ in enumerate(T):
		if S[i + j] != T[j]:
			changeCount+=1
	chageCountMin = min(chageCountMin,changeCount)
print(chageCountMin)

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

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
    if cnt < minDiff:
        minDiff = cnt
print(minDiff)

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

ans = 0
ans2 = 10000

for i in range(len(S)-len(T)+1):
    tmp = S[i:i+len(T)]
    ans = 0
    for j in range(len(T)):
        if tmp[j] != T[j]:
            ans += 1
    ans2 = min(ans,ans2)
            
print(ans2)

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

max_equal_count = 0

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

    if max_equal_count < equal_count:
        max_equal_count = equal_count

print(len(T) - max_equal_count)

Solution (Python):
s = input()
t = input()
best = len(t)
for i in range(len(s) - len(t) + 1):
    sub = s[i:i+len(t)]
    score = sum(x!=y for x,y in zip(sub,t))
    if score < best: best = score
print(best)

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

ans = float("inf")

for i in range(len(s) - len(t) + 1):
    num = 0
    for j in range(len(t)):
        if s[i + j] == t[j]:
            continue
        else:
            num += 1

    ans = min(ans, num)

print(ans)

Solution (Python):
s = input()
t = input()
n = len(s)
m = len(t)

ans = 10000

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

Solution (Python):
S = input()
T = input()
ev = []
for i in range(len(S) - len(T) + 1):
  commit = 0
  for j in range(len(T)):
    if S[i + j] == T[j]:
      commit += 1
  ev.append(commit)

ev.sort(reverse=True)
print(len(T) - ev[0])

Solution (Python):



































def match(s, t):
    ret = 0
    assert len(s) == len(t), (s, t)
    for i in range(len(s)):
        if s[i] == t[i]:
            ret += 1
    return ret


def main():
    s = input()
    t = input()
    ret = 1001

    for i in range(len(s)-len(t)+1):
        _ret = len(t) - match(s[i:i + len(t)], t)

        if ret > _ret:
            ret = _ret

    print(ret)


    return


if __name__ == "__main__":
    main()

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

slist = list(s)
tlist = list(t)
ans = 0
for i in range(len(slist)-len(tlist)+1):
    
    num = 0
    for k in range(len(tlist)):
        if slist[i+k] == tlist[k]:
            num += 1
    if num >= ans:
        ans = num
print(len(tlist)-ans)

Solution (Python):
import sys 
def minimumChar(S1, S2): 
    n, m = len(S1), len(S2) 
    ans = sys.maxsize 
    for i in range(m - n + 1): 
        minRemovedChar = 0
        for j in range(n): 
            if (S1[j] != S2[i + j]): 
                minRemovedChar += 1
        ans = min(minRemovedChar, ans) 
    return ans 

s = input()
t = input()
print(minimumChar(t,s))

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

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

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

N = len(T)

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

min_change = N
for i in range(len(S) - N+1):
    S_part = S[i:i + N]

    change = N
    for j in range(N):
        if (S_part[j] == T[j]):
            change = change - 1

    if (change < min_change):
        min_change = change

print(min_change)

Solution (Python):
import sys
S=sys.stdin.readline().strip()
T=sys.stdin.readline().strip()

ans=float("inf")
for i in range(len(S)-len(T)+1):
    temp_ans=0
    for s,t in zip(S[i:],T):
        if s!=t:
            temp_ans+=1
    ans=min(ans,temp_ans)
print ans

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

Solution (Python):
S = input().rstrip()
T = input().rstrip()
count = 0
lens = len(S)
lent = len(T)
for i in range(lens-lent+1):
    tempcount=0
    for j in range(lent):
        if S[i+j]==T[j]:
            tempcount += 1
    
    count = max(count,tempcount)

print(lent-count)

Solution (Python):
s=list(input())
t=list(input())
ans=len(t)
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 ans>x:
    ans=x
print(ans)