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

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

Solution (Python):
s = list(input())
t = list(input())
ls = len(s)
lt = len(t)

cnt = 0
for i in range(ls-lt+1):
  tmp = 0
  for j in range(lt):
    if s[i+j]==t[j]:
      tmp += 1
  cnt = max(cnt,tmp)
print(lt-cnt)

Solution (Python):
A = str(input())
B = str(input())
C = [0]*len(A)
for i in range(len(A)-len(B)+1):
    for j in range(len(B)):
        if A[i+j]==B[j]:
            C[i]+=1
print(len(B)-max(C))

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

LT = len(T)
minDiff = LT
for i in range(len(S) - len(T) + 1):
    U = S[i:i+LT]
    diff = 0
    for j in range(LT):
        if U[j] != T[j]:
            diff = diff + 1
    
    if diff <minDiff:
        minDiff = diff

print(minDiff)

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

out=[]
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
    out.append(cnt)
print(min(out))

Solution (Python):
import math
import sys

def dict_sort(ans):
    ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))

def is_prime(n):
    if n==1:
        return 0
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True

def swap(a,b):
    temp=a
    a=b
    b=temp
    return a,b

def seive_primes(n):
    flag=[0]*(n+10)
    flag[1]=flag[0]=1
    i=2
    while i*i<=n+1:
        if flag[i]==0:
            j=i*i
            while j<=n+1:
                flag[j]=1
                j+=i
        i+=1
    return flag

def checkRecursive(x, n, curr_num=1, curr_sum=0): 
    results = 0 
    p = curr_num**n 
    while(p + curr_sum < x):  
        results += checkRecursive(x, n, curr_num + 1, p + curr_sum) 
        curr_num = curr_num + 1
        p = curr_num**n  
    if(p + curr_sum == x): 
        results = results + 1
    return results

def findMinSwap(arr, n): 
    vec = [] 
    for i in range(n): 
        vec.append([arr[i], i])  
    vec = sorted(vec) 
    ans, c, j = -1, 0, 0
    for i in range(n):  
        if(vec[i][1] == i): 
            continue
        else:  
            vec[i][0], vec[vec[i][1]][1] = swap(vec[i][0],vec[vec[i][1]][1])
            vec[i][1], vec[vec[i][1]][1] = swap(vec[i][1],vec[vec[i][1]][1]) 
        if(i != vec[i][1]): 
            i -= 1
        ans += 1
    return ans

def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

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

def alphabates():
    return "abcdefghijklmnopqrstuvwxyz"

def binary_search(ls,n,flag):
    low=0
    hi=n-1
    while(low<=hi):
        mid=(low+hi)//2
        if ls[mid]==flag:
            return mid
        elif ls[mid]>flag:
            hi=mid-1
        else:
            low=mid+1
    return -1

def Binary(n):
    if n==0:
        return "00000000"
    binary = "" 
    i = 0
    while n > 0 and i<=8: 
        s1 = str(int(n%2)) 
        binary = binary + s1 
        n /= 2
        i = i+1
        d = binary[::-1] 
    return d

def qdrt(x,a,b,c):
    return a*x*x+b*x+c

def inp():
    ls=list(map(int,input().split()))
    return ls

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

def knapSack(W, wt, val, n): 
    K = [[0 for x in range(W + 1)] for x in range(n + 1)]  
    for i in range(n + 1): 
        for w in range(W + 1): 
            if i == 0 or w == 0: 
                K[i][w] = 0
            elif wt[i-1] <= w: 
                K[i][w] = max(val[i-1]+K[i-1][w-wt[i-1]],  K[i-1][w]) 
            else: 
                K[i][w] = K[i-1][w] 
  
    return K[n][W] 

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

Solution (Python):
s = input()
t = input()
n = len(s) - len(t) + 1
ans = 1001001001
for i in range(n):
    ans = min(ans, sum(j!=k for j, k in zip(s[i:i+len(t)], t)))
print(ans)

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

maxsame = 0

for i in range(len(s)-len(t)+1):
  same = 0
  for j in range(len(t)):
    if s[i+j] == t[j]:
      same += 1
  if same > maxsame:
    maxsame = same
    
print(len(t)-maxsame)

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

s_list=list(S)
t_list=list(T)
maxmax=0
for i in range(len(S)-len(T)+1):
    ss=len([j for j in range(len(T)) if s_list[i+j]==t_list[j]])
    if maxmax<ss:
        maxmax=ss
print(str(len(T)-maxmax))

Solution (Python):
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    S = input()
    T = input()

    num = len(S) - len(T)+1

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


if __name__ == '__main__':
    main()

Solution (Python):
s = list(input())
t = list(input())
count_max = 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 +=1
    count_max = max(count,count_max)
print(len(t)-count_max)

Solution (Python):
s = input()
t = input()
c = []

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

            counter += 1


    c.append(counter)

print(len(t)-max(c))

Solution (Python):
S = input()
T = input()
ans = len(T)
n1 = len(S)-len(T)+1
for i in range(n1):
    ans2 = 0
    for k in range(len(T)):
        
        if S[k+i] != T[k]:
            ans2 += 1
    
    ans = min([ans,ans2])
    
print(ans)

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

Solution (Python):
s=input()
t=input()
sn=len(s)
tn=len(t)
ans=float('INF')
for i in range(sn-tn+1):
  cnt=0
  for j in range(tn):
    if s[i+j]!=t[j]:
      cnt+=1
  ans=min(ans,cnt)
print(ans)

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

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

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

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

print(len(T)-max(count_list))

Solution (Python):
S=input()
T=input()
x=len(S)
y=len(T)
l=[]
for i in range(x-(y-1)):
    s=0
    for j in range(y):
        if S[j+i]==T[j]:
            s+=1
    l.append(y-s)
print(min(l))

Solution (Python):
def solve(l_1,l_2):
    result = 0
    for i,j in zip(l_1,l_2):
        if i != j:
            result += 1
    return result

s = input()
t = input()
n_s = len(s)
n_t = len(t)
ans = 10**5

for i in range(0,n_s-n_t+1):
    l = s[i:i+n_t]
    ans = min(ans,solve(t,l))

print(ans)

Solution (Python):

import math
import bisect
import copy
import time
from collections import Counter
from itertools import combinations


s=input()
x=input()
if x in s:
	print(0)
else:
	ans=10**9
	for i in range(len(s)-len(x)+1):
		c=0
		for j in range(len(x)):
			if s[i+j]!=x[j]:
				c+=1
		ans=min(ans,c)
	print(ans)

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

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

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S = input()
    T = input()

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


main()

Solution (Python):
def resolve():
    s = input()
    t = input()
    ls = len(s)
    lt = len(t)
    c = []
    for i in range(ls - lt + 1):
        count = 0
        for j in range(lt):
            if s[i+j] == t[j]:
                count += 1
        c.append(count)
    print(lt - max(c))
resolve()

Solution (Python):
s = input()
t = input()
ls = len(s)
lt = len(t)
ans = float('inf')
for i in range(ls - lt + 1):
    cnt = 0
    for j in range(lt):
        if s[i + j] != t[j]:
            cnt += 1
    ans = min(ans, cnt)
print(ans)

Solution (Python):



s = input()
t = input()
ans = 10000
count = 0
for i in range(len(s)-len(t)+1):
  for j in range(len(t)):
    if s[i+j] != t[j]:
      count += 1
  if ans > count:
    ans = count
  count = 0
print(ans)

Solution (Python):

S = input()
T = input()

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

ans = 10 ** 5
for i in range(len(S) - (len(T) - 1)):
    c = len(T)
    for j in range(len(T)):
        if T[j] == S[i + j]:
            c -= 1
    ans = min(ans, c)

print(ans)

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

l_s, l_t=len(S), len(T)
ans=len(T)
for i in range(l_s-l_t+1):
    string=S[i:i+l_t]
    count=0
    for j in range(l_t):
        if T[j]!=string[j]:
            count+=1
    if count<ans:
        ans=count
print(ans)

Solution (Python):
import numpy as np

S = list(input())
T = list(input())

s_len = len(S)
t_len = len(T)

max_same = 0
for i in range(s_len-t_len+1):
    tmp_s = S[i:i+t_len]
    count_same = 0
    for j in range(t_len):
        if T[j] == tmp_s[j]:
            count_same += 1
    if count_same > max_same:
        max_same = count_same
print(t_len-max_same)

Solution (Python):
S=input()
T=input()
min_lts = len(S)
for i in range(len(S)-len(T)+1):
  count = 0
  for k in range(len(T)):
    if S[i+k] != T[k]:
      count = count + 1
  min_lts = min([min_lts,count])

print(min_lts)

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

a = 0
ans = len(T)
c = len(T)


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

Solution (Python):
s = input()
t = input()
maxa = 0
answer = 0
for i in range(len(t)):
    if t[i] in s[i:]:
        for j in range(len(s[i:])):
            if t[i] == s[i+j] and j + len(t) <= len(s):
                for k in range(len(t)):
                    if t[k] == s[j+k]:
                        answer += 1
                if answer > maxa:
                    maxa = answer
                answer = 0
print(len(t) - maxa)

Solution (Python):
S = input()
T = input()
maxs = 0
for x in range(len(S)-len(T)+1):
    count=0
    for y in range(len(T)):
        if T[y] == S[x+y]:
            count += 1
        maxs = max(count,maxs) 

print(len(T)-maxs)

Solution (Python):
s = str(input())
t = str(input())
ls = len(s)
lt = len(t)
a = 0
for i in range(ls):
    if i >= lt:
        break
    if s[i] != t[i]:
        a += 1
for i in range(1, ls-lt+1):
    b = 0
    for j in range(i, ls):
        if j - i >= lt:
            break
        if s[j] != t[j-i]:
            b += 1
    if b < a:
        a = b
print(a)

Solution (Python):
S = input()
T = input()
sofar = len(T)
ans = 0
for i in range(len(S)):
    if len(S[i:]) >= len(T):
        count = 0
        for j in range(len(T)):
            if S[i + j] != T[j]:
                count += 1
        sofar = min(count, sofar)
ans = sofar
print(ans)

Solution (Python):
if __name__ == '__main__':

    S = list(input())
    T = list(input())

    len_s = len(S)
    len_t = len(T)

    ans = 0
    tmp = 0
    for i in range(len_s-len_t+1):
        A = S[i:i+len_t]
        for j,k in zip(A,T):
            if j == k:
                tmp+=1
        ans = max(ans,tmp)
        tmp = 0
    print(len_t-ans)

Solution (Python):
s = input()
t = input()
kari_result = 0
min_result = 10000000000
for i in range(len(s)-len(t)+1):
    for l in range(len(t)):
        if s[i+l] != t[l]:
            kari_result += 1
    if kari_result < min_result:
        min_result = kari_result
    kari_result = 0
print(min_result)

Solution (Python):
S = input()
T = input()
N = len(S)
L = len(T)

ans = float("inf")
for i in range(N):
    if N-i < L:
        break
    tmp = 0
    for s, t in zip(S[i:i+L], T):
        if s != t:
            tmp += 1
    if ans > tmp:
        ans = tmp

print(ans)

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

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

result = len(s)
for i in range(len(s) -len(t) + 1):
  result1 = 0
  k = i
  for j in range(len(t)):
    if s[k] != t[j]:
      result1 += 1
    k += 1
  if result > result1:
    result = result1
    
print(result)

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

l = []
for i in range(len(s)-len(t)+1) :
    moji = s[i]
    for j in range(len(t)-1) :
        moji += s[i+j+1]
    l.append(moji)
    moji = ""
c = 0
ans = 1000
for i in range(len(l)):
    c = 0
    for j in range(len(t)):
        if l[i][j] != t[j] :
            c += 1
    if ans > c :
        ans = c
print(ans)

Solution (Python):
s = list(input())
t = list(input())
ls = len(s)
lt = len(t)
if ls == lt:
    ans = 0
    for i in range(lt):
        if s[i] != t[i]:
            ans += 1
    print(ans)
else:
    ans = ls
    for i in range(ls-lt):
        cnt = 0
        for j in range(lt):
            if s[i+j] != t[j]:
                cnt += 1
        ans = min(ans,cnt)
    print(ans)

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

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

ans = 0

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

print(len_t - ans)

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

b = len(s)
a = len(t)

min_cnt = 100000000

for i in range(b - a + 1):
    cnt = 0
    for j in range(a):
        if s[j+i] != t[j]:
            cnt += 1
    
    if min_cnt > cnt:
        min_cnt = cnt

print(min_cnt)

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

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

cost = 10**9+7

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

Solution (Python):
S=str(input())
T=str(input())
min_count=len(T)
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
    min_count=min(count,min_count)
print(min_count)

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

    
    max_counter = 0

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

    answer = len(t) - max_counter
    print(answer)


if __name__ == "__main__":
    main()

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

def func(a,b):
    cnt = 0
    for c1,c2 in zip(a, b):
        if c1 != c2:
            cnt += 1
    return cnt

t_max = 10000
for i in range(len(s) - len(t) + 1):
    tmp = func(s[i:i+len(t)], t)
    if tmp < t_max:
        t_max = tmp
print(t_max)

Solution (Python):
s=str(input())
t=str(input())
a=len(s)-len(t)
A=[]
d=0
if a==0:
    for k in range(len(t)):
        if t[k]!=s[k]:
            d+=1
    print(d)
else:    
    
    for i in range(a):
        b=0
        for j in range(len(t)):
            if t[j]==s[j+i]:
                b+=1
        A.append(b)

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

Solution (Python):
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


S = _S()
T = _S()
ans = 0

ls = len(S)
lt = len(T)
count = [0]*(ls-lt+1)
for i in range(ls-lt+1):
    for j in range(lt):
        if S[i+j]==T[j]:
            count[i]+=1
ans = lt - max(count)

print(ans)

Solution (Python):

import sys


def main():
    S = sys.stdin.readline().rstrip()
    T = sys.stdin.readline().rstrip()

    min_cnt = 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 += 1
        
        min_cnt = min(min_cnt, cnt)
    
    
    print(min_cnt)


if __name__ == "__main__":
    main()

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

count = 0
reg = 0

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

reg = len(t) - reg
print(reg)

Solution (Python):
S = input()
T = input()
gap1 = 0
gap2 = len(S) - len(T)
x = 0
ans = 0
while gap1<= gap2:
    itti = 0
    for i in range(len(T)):
        if T[i] == S[gap1+i]:
            itti += 1
    gap1 += 1
    ans = max(ans,itti)
print(len(T)-ans)

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

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

ans = len_t
for i in  range(len_s - len_t+1):
    s_sub = s[i:len_t + i]
    ans  = min(ans, len([... for i in range(len_t) if t[i] != s_sub[i]]))
print(ans)

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

Solution (Python):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    S = input()
    T = input()

    numdic = [0]*(100000)
    for i in range(len(S)+1-len(T)):
        small = S[i:i+len(T)]
        same = 0
        for s in range(len(T)):
            if small[s] == T[s]:
                same += 1
        numdic[i] = same

    ans = len(T) - max(numdic)
    print(ans)




if __name__ == '__main__':
    solve()

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

MIN=len(T)
for n in range(len(S)-len(T)+1):
    cnt=0
    for i in range(len(T)):
        if T[i]!=S[n+i]:
            cnt+=1
    MIN=min(MIN,cnt)
print(MIN)

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

cnt = 0
for i in range(len(S) - len(T) + 1):
    s = S[i:i+len(T)]
    tmp = 0
    for j, t in enumerate(T):
        if s[j] == t:
            tmp += 1
    cnt = max(cnt, tmp)

print(len(T) - cnt)

Solution (Python):
A=input()
B=input()
ans=float("inf")
for i in range(len(A)-len(B)+1):
   C=A[i:i+len(B)]
   tmp=0
   for j in range(len(B)):
      if C[j] != B[j]:
         tmp+=1
   ans=min(tmp,ans)
print(ans)

Solution (Python):
s = input()
t = input()
x = 0
for i in range(0,len(s)-len(t)+1):
    p = s[i:i+len(t)]

    y = 0
    for j in range(0,len(t)):
        if p[j] == t[j]:
            y = y + 1

    if y >= x:
        x = y

print(len(t) - x)

Solution (Python):

S = input()
T = input()

mincnt = 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 += 1
  mincnt = min(mincnt, cnt)
print(mincnt)

Solution (Python):

s = input()
t = input()


def diff(a, b, minCount):
    count = 0
    for i in range(len(a)):
        if a[i] != b[i]:
            count += 1
    return min(minCount, count)


minc = 1001
for i in range(0, 1 + len(s) - len(t)):
    minc = diff(s[i: i + len(t)], t, minc)
print(minc)

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

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

minimum = tlength

for i in range(slength - tlength + 1):
    count = 0
    for j in range(tlength):
        if t[j] != s[i + j]:
            count += 1
    if minimum > count:
        minimum = count

print(minimum)

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

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

print(m)

Solution (Python):
S = str(input())
T = str(input())
X = []

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
    X.append(cnt)

print(len(T)-max(X))

Solution (Python):
def diff(s,t):
    assert len(s) == len(t)
    
    c = 0
    for i,j in zip(s,t):
        if i != j:
            c+=1
        else:
            pass
    return c
s=input()
t=input()
n=len(s)
m=len(t)
min_=10**5
for i in range(n-m+1):
    min_=min(min_,diff(s[i:m+i],t))
print(min_)

Solution (Python):



import collections
import sys
import copy
import re
import math


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    S1 = S()
    T = S()

    ans = float("inf")

    for i in range(0, len(S1)):

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


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    S=input()
    T=input()
    max_count = 0
    for i in range(len(S)-len(T)+1):
        tmp_count = 0
        for j in range(len(T)):
            if S[i+j] == T[j]:
                tmp_count = tmp_count+1
        if tmp_count > max_count:
            max_count = tmp_count

    print(len(T)-max_count)
    
    
    

main()

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

cnt = [0 for x in range(len(S)-len(T)+1)]
for i in range(len(S)-len(T)+1):
    target = S[i:i+len(T)]
    for j in range(len(T)):
        if target[j] != T[j]:
            cnt[i] += 1

print(min(cnt))

Solution (Python):
s=input()
l=input()
len_s=len(s)
len_l=len(l)
a=len_s-len_l
ans=1001
for i in range(len_s-len_l+1):
    cnt=0
    for j in range(len_l):
        if l[j]!=s[i+j]:
            cnt+=1
    ans=min(ans,cnt)

print(ans)

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

max_equal = 0

for i in range(len(S)-len(T)+1):
    tmp = 0
    for j in range(len(T)):
        tmp += (S[i:len(T)+i][j] == T[j])
    max_equal = max(max_equal, tmp)
    
print(len(T) - max_equal)

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

min_count = len(S)

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

print(min_count)

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

n = len(s)
m = len(t)
ans = float("inf")
for i in range(n-m+1):
  p = 0
  for j in range(m):
    if s[i+j] != t[j]: p += 1
  if p < ans: ans = p
print(ans)

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

ls, lt = len(s), len(t)
min_diff = 1000

for i in range(0, ls-lt+1):
	subs = s[i:i+lt]
	diff = lambda x, y: sum([1 if char1 != char2 else 0 for char1, char2 in zip(x, y)])
	min_diff = min(min_diff, diff(subs, t))

print(min_diff)

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

if t in s:
    print(0)
else:
    ans = 10000000
    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(ans,tmp)
    print(ans)

Solution (Python):
S=input()
T=input()
n=len(S)-len(T)+1
t=len(T)
if S.find(T)!=-1:
    print(0)
else:
    tmp=0
    id=-1
    for i in range(n):
        cnt=0
        for j in range(t):
            if S[i+j]==T[j]:
                cnt+=1
        if cnt>tmp:
            tmp=cnt
            id=i
    print(t-tmp)

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

match = 0
k = 0
result = 0
for i in range(len(S)-len(T)+1) :
    k = i 
    match = 0
    for j in range(len(T)) :
        
        if T[j] == S[k] :
            match = match + 1
        k += 1
    result = max(result,match)

print(len(T) - result)

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

Solution (Python):
import sys
from sys import exit
from math import gcd, factorial, ceil, floor, sqrt
from bisect import bisect_left, bisect_right
from copy import deepcopy
from heapq import heapify, heappop, heappush
from itertools import permutations, combinations, product, accumulate
from collections import defaultdict, deque, Counter
sys.setrecursionlimit(10**7)

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

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

Solution (Python):
import numpy as np
x = input()
y = input()

a=np.array(list(x))
b=np.array(list(y))
ans=0

for i in range(len(a)-len(b)):    
    tmp=(a[i:len(b)+i]==b).sum()
    if ans<tmp:
        ans=tmp
        
if len(a)==len(b):
    print(len(b)-(a==b).sum())
else:
    print(len(b)-ans)

Solution (Python):
import numpy as np

s = np.array(list(input()), dtype=np.unicode)
t = np.array(list(input()), dtype=np.unicode)

ls = len(s)
lt = len(t)
L = ls- lt + 1
dif = np.empty(L, dtype=np.int64)
for i in range(L):
    dif[i] = np.count_nonzero(s[i:i+lt] != t)
ans = np.min(dif)
print(ans)

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

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

def kakikae_count(S_i):
    count = 0
    for i in range(len(T)):
        if S[S_i + i] != T[i]:
            count += 1
    return count

min_count = len(T)
for i in range(0, len(S) - len(T) + 1):
    need_count = kakikae_count(i)
    if need_count < min_count:
        min_count = need_count
print(min_count)

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

INF = 10**9
min_ans = INF
for i in range(len(s)-len(t)+1):
    c = 0
    for j in range(len(t)):
        si = s[i+j]
        ti = t[j]
        
        if si == ti:
            c += 1
    min_ans = min(min_ans, len(t)-c)
print(min_ans)

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

def find_common(s1, s2):
    count = 0
    for c,y in zip(s1, s2):
        if c == y:
            count += 1
    return count

start = 0 
end =  len(t)
ans  = 0
while end <= len(s):
    ans  = max(ans, find_common(t, s[start:end]))
    start+=1
    end+=1
print(len(t)- ans)

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

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

ans = 10004
cnt = 0
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(ans, cnt)
print(ans)

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

match = 0
for l in range(len(s)-len(t)+1):
    ma = 0
    for m in range(len(t)):
        if s[l+m] == t[m]:
            ma += 1
        match = max(match, ma)
            
print(len(t)-match)

Solution (Python):
S = input()
T = input()
ans = 1000
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 = min(ans, cnt)
print(ans)

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

cnt = 0
tmp = 0

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

for i in range(ls-lt+1):
    for j in range(lt):
        if s[i+j]==t[j]:
            tmp += 1
    cnt = max(cnt,tmp)
    tmp = 0

print(lt-cnt)

Solution (Python):
from sys import stdin, stdout
def gmi(): return map(int, stdin.readline().strip().split())
def gms(): return map(str, stdin.readline().strip().split())
def gari(): return list(map(int, stdin.readline().strip().split()))
def gars(): return list(map(int, stdin.readline().strip().split()))
def gs(): return stdin.readline().strip()
def gls(): return list(stdin.readline())
def gi(): return int(stdin.readline())

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

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

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

len_S = len(S)
len_T = len(T)

ans = len_T
for i in range(0, len_S - len_T + 1):
    match = 0
    for s, t in zip(S[i:i + len_T], T):
        if s == t:
            match += 1
    change = len_T - match
    ans = min(ans, change)

print(ans)

Solution (Python):
def main():
    s = input()
    t = input()
    s_len = len(s)
    t_len = len(t)
    if s==t:
        print(0)
        exit()

    max_match = 0
    for k1 in range(s_len - t_len + 1):
        match = 0
        for k2 in range(t_len):
            if s[k1+k2]==t[k2]:
                match+=1
        max_match = max(match, max_match)
    print(t_len - max_match)

if __name__=="__main__":
    main()

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

max = 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 count > max:
        max = count

print(len(T) - max)