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):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    s=STR()
    t=STR()
    ls=len(s)
    lt=len(t)
    ans=10**9
    for i in range(ls-(lt-1)):
        temp=0
        for k in range(lt):
            if s[i+k]!=t[k]:
                temp+=1
        ans=min(temp,ans)
    print(ans)
        

if __name__=='__main__':
    do()

Solution (Python):
S=input()
T=input()
ans=float("INF")
for i in range(0,len(S)-len(T)+1):
    now=0
    for j in range(len(T)):
        if S[i+j]!=T[j]:
            now+=1
    ans=min(now, ans)

print(ans)

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

N = len(S)
M = len(T)
ans = N

for i in range(N-M+1):
    cnt = 0
    for j,t in enumerate(T):
        if t != S[i+j]: cnt += 1
    ans = min(ans,cnt)

print(ans)

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

Solution (Python):
S = input()
T = input()
L = len(T)
res = 10000
for i in range(len(S)-L+1):
    tmp = 0
    for a, b in zip(list(S[i:i+L]), list(T)):
        tmp += 1 if a != b else 0
    res = min(tmp, res)
print(res)

Solution (Python):
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce, lru_cache
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

s = input()
t = input()

ans = inf
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):
import sys

if sys.subversion[0] == "PyPy":
    import io, atexit

    sys.stdout = io.BytesIO()
    atexit.register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

    sys.stdin = io.BytesIO(sys.stdin.read())
    input = lambda: sys.stdin.readline().rstrip()
RS = raw_input
RA = lambda x=int: map(x, RS().split())
RN = lambda x=int: x(RS())


def solve():
    best = 2000
    ls = len(s)
    lt = len(t)
    for i in range(ls - lt + 1):
        diff = 0
        for j in range(lt):
            if t[j] != s[j + i]:
                diff += 1
        best = min(best, diff)
    print(best)
    return




s = RS()
t = RS()
solve()

Solution (Python):
import sys

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

    sl = len(S)
    tl = len(T)

    res = tl
    for i in range(sl-tl+1):
        count = 0
        s = S[i:i+tl]
        for ti, si in zip(T, s):
            if ti != si:
                count += 1
        if count < res:
            res = count

    print(res)

if __name__ == "__main__":
    main()

Solution (Python):


S = input()
T = input()
ret = 10**9
for i in range(len(S)-len(T)+1):
    s = S[i:i+len(T)]
    c = 0
    for j in range(len(s)):
        if s[j] != T[j]:
            c += 1
    ret = min(c, ret)

print(ret)

Solution (Python):
s=input()
t=input()
ans = 10**9
for i in range(len(s)):
    
    val = 0
    for j in range(len(t)):
        if i+j >= len(s):
            break
        si = s[i+j]
        ti = t[j]
        
        if si != ti:  val += 1
    else:
        ans = min(ans,val)

print(ans)

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

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

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

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque, defaultdict


from collections import Counter

from itertools import accumulate,combinations,permutations,product

from heapq import heapify,heappop,heappush

from functools import reduce,lru_cache

from decimal import Decimal
from argparse import ArgumentParser

args=ArgumentParser()
args.add_argument('-loc', '--local', type=bool,default=False)
LOCAL=args.parse_args().local

def input(): 
    x=sys.stdin.readline(); 
    if x[-1]=="\n": 
        return x.rstrip() 
    return x
    
def printe(*x):_=print("
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): 
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    

    
    
    
    
    
    s=input()
    t=input()
    ls=len(s)
    lt=len(t)
    tc=100000
    for i in range(ls-lt+1):
        cnt=0
        for j in range(lt):
            if t[j]!=s[j+i]:
                cnt+=1
        tc=min(cnt,tc)
    print(tc)


if __name__ == "__main__":
    main()

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

Solution (Python):
s=input()
t=input()
n=len(s)
n1=len(t)
tot=n
for i in range(n):
    ans=0
    f=0
    for j in range(n1):
        if i+j>=n:
            f=1
            break
        if s[i+j]==t[j]:
            continue
        else:
            ans+=1
    if f==0:
        tot=min(tot,ans)
print(tot)

Solution (Python):
from sys import stdin, stdout
import heapq
import cProfile
from collections import Counter, defaultdict, deque
from functools import reduce
import math


def get_int():return int(stdin.readline().strip())
def get_tuple():return map(int, stdin.readline().split())
def get_list():return list(map(int, stdin.readline().split()))

s = input()
t = input()
ans = float('inf')
n,m = len(s),len(t)
for i in range(n-m+1):
    c = 0
    for j in range(m):
        if s[i+j]!=t[j]: c+= 1
    ans = min(ans,c)
print(ans)

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

diff = len(s) - len(sub)
ans = 10000
for i in range(diff + 1):
    temp = 0
    for idx in range(len(sub)):
        if s[idx+i] != sub[idx]:
            temp += 1
    ans = min(ans, temp)

print(ans)

Solution (Python):
S=input()
T=input()
r=1000
for i in range(len(S)-len(T)+1):
    r=min(r,sum([S[i+j]!=T[j] for j in range(len(T))]))
print(r)

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

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

n = len(T)
res = n
for i in range(len(S) - n + 1):
    count = 0
    for c1, c2 in zip(S[i: i + n], T):
        if c1 != c2:
            count += 1
    res = min(count, res)
print(res)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

LS = len(S)
LT = len(T)

ans = LT
for i in range(LS - LT + 1):
    t = 0
    for j in range(LT):
        if S[i + j] != T[j]:
            t += 1

    ans = min(ans, t)

print(ans)

Solution (Python):

import sys
input = sys.stdin.readline

s = input().rstrip()
t = input().rstrip()
ns = len(s)
nt = len(t)

ans = 10**5 
for i in range(ns - nt + 1):
    ret = 0
    for cs, ct in zip(s[i:i+nt], t):
        if cs != ct:
            ret += 1
    ans = min(ans, ret)
print(ans)

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

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


if __name__ == '__main__':
    main()

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

result = 10**9
for i in range(len(S)-len(T)+1):
    d = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            d += 1
    result = min(result, d)

print(result)

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

Solution (Python):
import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



S = input()
T = input()

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

Solution (Python):
s=input()
t=input()
ans=len(t)
def f(s,t):
    a=0
    for i,j in zip(s,t):
        a+=i!=j
    return a

for i in range(len(s)-len(t)+1):
    ans=min(ans,f(t,s[i:len(t)+i]))
print(ans)

Solution (Python):
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

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

yes = "Yes"
no = "No"


def main():
    s = input()
    t = input()
    ans = 100000
    for i in range(len(s) - len(t) + 1):
        anstmp = 0
        for j in range(len(t)):
            if s[i + j] != t[j]:
                anstmp += 1
        ans = min(ans, anstmp)

    print(ans)


main()

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

Solution (Python):


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  
from itertools import combinations as comb  
from itertools import permutations as permutate
from bisect import bisect_left as bl



from bisect import bisect_right as br
from bisect import bisect







BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None


    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)





from types import GeneratorType


def iterative(f, stack=[]):
    def wrapped_func(*args, **kwargs):
        if stack: return f(*args, **kwargs)
        to = f(*args, **kwargs)
        while True:
            if type(to) is GeneratorType:
                stack.append(to)
                to = next(to)
                continue
            stack.pop()
            if not stack: break
            to = stack[-1].send(to)
        return to

    return wrapped_func







mod = 1000000007


def inp(): return sys.stdin.readline().rstrip("\r\n")  

def out(var): sys.stdout.write(str(var))  

def lis(): return list(map(int, inp().split()))

def stringlis(): return list(map(str, inp().split()))

def sep(): return map(int, inp().split())

def strsep(): return map(str, inp().split())


def zerolist(n): return [0] * n

def nextline(): out("\n")  

def testcase(t):
    for p in range(t):
        solve()

def printlist(a):
    for p in range(0, len(a)):
        out(str(a[p]) + ' ')

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

def power(x, y, p):
    res = 1  
    x = x % p  
    if (x == 0):
        return 0
    while (y > 0):
        if ((y & 1) == 1):  
            res = (res * x) % p

        y = y >> 1  
        x = (x * x) % p
    return res

def ncr(n, r): return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
    if (n <= 1): return False
    if (n <= 3): return True
    if (n % 2 == 0 or n % 3 == 0): return False
    i = 5
    while (i * i <= n):
        if (n % i == 0 or n % (i + 2) == 0):
            return False
        i = i + 6
    return True


s=inp()
t=inp()
mi=9999999990999999999
for i in range(len(s)-len(t)+1):
    d=0
    for j in range(i,i+len(t)):
        if s[j]!=t[j-i]:
            d+=1
    mi=min(d,mi)
print(mi)

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

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

ans = 10000
for i in range(num):
    S_tmp = S[i:i+t]
    tmp_ans = 0
    for j, k in zip(S_tmp, T):
        if j!=k:
            tmp_ans += 1
    
    ans = min(ans, tmp_ans)

print(ans)

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


ans=10**7
for i in range(len(s)-len(t)+1):
  ansi=0
  for j in range(len(t)):
    if s[i+j]!=t[j]:
      ansi+=1
  ans=min(ans,ansi)

print(ans)

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

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

Solution (Python):

s = input()
t = input()
a ,b = len(s), len(t)
c = INF = float("inf")
for i in range(a - b + 1):
    c = min(c, sum(d != e for d, e in zip(s[i:i+b], t)))
print(c)

Solution (Python):
s = input()
t = input()
ans = len(t)
for i in range(1+len(s)-len(t)):
    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 = list(input())
t = list(input())

l = []
for start in range(len(s)-len(t)+1):
    cnt = 0
    for i in range(len(t)):
        if t[i] != s[start+i]:
            cnt += 1
    l.append(cnt)
print(min(l))

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

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

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

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

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

ans = 10000

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

print(ans)

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

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

print(ans)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

s = input()
t = input()

ans = float('inf')

for i in range(len(s)):
    temp = s[i:]
    if len(temp) < len(t):
        break
    cnt = 0
    for j in range(len(t)):
        if temp[j] != t[j]:
            cnt += 1
    ans = min(cnt, ans)
print(ans)

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

ans = len(t)
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=input()
t=input()
q=len(s)
w=len(t)
def qwe(s,t):
    ans=0
    for i,j in zip(s,t):
        if i!=j:
            ans+=1
    return ans

ans=10**10
for i in range(q-w+1):
    ans=min(ans, qwe(s[i:i+w], t))
print(ans)

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

m = 0
for i in range(len(S)-len(T)+1):
    s = S[i:i+len(T)]
    cnt = 0
    for j in range(len(T)):
        if s[j]==T[j]:
            cnt+=1
    if m<cnt:
        m = cnt
print(len(T)-m)

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

Solution (Python):
S = input()
T = input()
minA = float("inf")
for i in range(len(S) - len(T) + 1):
    sumA = 0
    for j in range(len(T)):
        if S[i + j] != T[j]:
            sumA += 1
    minA = min(minA, sumA)
print(minA)

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

ans=1<<30
for i in range(len(s)-len(t)+1):
    ss=s[i:i+len(t)]
    cnt=0
    for j in range(len(t)):
        if ss[j]!=t[j]:cnt+=1
    ans=min(ans,cnt)

print(ans)

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

ans = 10**5
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
    ans = min(ans, c)
print(ans)

Solution (Python):
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18






S = input()
T = input()


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

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

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

Solution (Python):



import queue 




    






mod = int(1e9+7)

INF = 1<<50

def readInt():
    return list(map(int,input().split()))

def main():
    s = input()
    t = input()
    ans = INF
    for i in range(len(s)-len(t)+1):
        res = 0
        for j in range(len(t)):
            if s[i+j]!=t[j]:
                res += 1
        ans = min(ans,res)
    print(ans)
    return

if __name__=='__main__':
    main()

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

res = 10 ** 5
for i in range(len(S) - len(T) + 1):
    tmp = 0
    for j in range(len(T)):
        if T[j] != S[i + j]:
            tmp += 1
    res = min(res, tmp)

print(res)

Solution (Python):
s=input()
t=input()
mn=len(s)
for i in range(len(s)-len(t)+1):
  cnt=0
  for (x,y) in zip(t,s[i:i+len(t)]):
    if x!=y:
      cnt+=1
  mn=min(cnt,mn)
print(mn)

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

s = len(S)
t = len(T)
ans = t
for i in range(s - t+1):
    count = 0
    for a, b in zip(S[i:], T):
        if a != b:
            count += 1
    if ans > count:
        ans = count

print(ans)

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

def count(x,y):
    return sum(xi!=yi for xi,yi in zip(x,y))
    
ans = min(count(s[i:i+len(t)],t) for i in range(len(s)-len(t)+1))
print(ans)

Solution (Python):
def resolve():
    s = input()
    t = input()
    ans = 10000
    lens = len(s)
    lent = len(t)
    for i in range(lens - lent + 1):
        x = 0
        for j in range(lent):
            if s[i + j] != t[j]:
                x += 1
        ans = min(ans, x)
    print(ans)


if __name__ == '__main__':
    resolve()

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(ans,tmp)

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

s=SI()
t=SI()
sn=len(s)
tn=len(t)
ans=100000
for i in range(sn-tn+1):
    cur=0
    for j in range(tn):
        cur+=s[i+j]!=t[j]
    ans=min(ans,cur)
print(ans)

Solution (Python):
s=input()
t=input()
ans = 9999999999999
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()

ls = len(S)
lt = len(T)
ans = 1<<60
for i in range(ls-lt+1):
    cnt = 0
    X = S[i:i+lt]
    for x, t in zip(X, T):
        if x != t:
            cnt += 1
    ans = min(ans, cnt)
print(ans)

Solution (Python):
s=input()
t=input()
ans=1000000
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):

from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

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

ma = 10**10

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

print(ma)

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

def calc(i):
    d = 0
    
    for j in range(len(T)):
        if S[i+j]!=T[j]:
            d += 1
    
    return d
    
S = input()[:-1]
T = input()[:-1]
ans = 10**18

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

print(ans)

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

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

print(res)

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

ans = 10000
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_s=len(s)
len_t=len(t)
cnt=0
ans=len_s
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
  ans=min(ans,cnt)
print(ans)

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


def d(s, t):
    cnt = 0
    for i in range(len(s)):
        if s[i] != t[i]:
            cnt += 1
    return cnt


n = len(s)
m = len(t)
ans = 1000000
for i in range(n - m + 1):
    ans = min(ans, d(s[i:i + m], t))
print(ans)

Solution (Python):
def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    S = input().strip()
    T = input().strip()
    ans = float('inf')
    for i in range(len(S)-len(T)+1):
        ans_ = 0
        for j in range(len(T)):
            if S[i+j] != T[j]:
                ans_ += 1
        ans = min(ans, ans_)
    print(ans)

if __name__ == '__main__':
    main()

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

ans = 10000
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):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    S = input()
    T = input()
    ls = len(S)
    lt = len(T)

    ans = INF
    for i in range(ls - lt + 1):
        cur = 0
        for j in range(lt):
            if S[i + j] != T[j]:
                cur += 1
        ans = min(ans, cur)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache





MOD = 10**9+7
INF = float('inf')
AZ = "abcdefghijklmnopqrstuvwxyz"






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]



def DD(arg): return defaultdict(arg)


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n): return kaijo_memo[n]
  if(len(kaijo_memo) == 0): kaijo_memo.append(1)
  while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if n == r: return 1
  if n < r or r < 0: return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1: arr.append([temp, 1])
  if arr==[]: arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b: a, b = b, a % b
    return a


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


def count_bit(n):
  count = 0
  while n:
    n &= n-1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n: return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

def base_10_to_n_without_0(X, n):
  X -= 1
  if X//n: return base_10_to_n_without_0(X//n, n)+[X%n]
  return [X%n]


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





A = S()
B = S()

NA = len(A)
NB = len(B)

ans = INF
for i in range(NA-NB+1):
  c = 0
  for j in range(NB):
    if A[i+j] != B[j]:
      c += 1
  ans = min(ans,c)
print(ans)

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