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



Sample input:
cabacc
abc


Sample output:
1

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    T = input()
    print(S)
    print(T)
    min = 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 temp < min:
            min = temp
    print(min)
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

c=10**10
ans=0

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

print(ans)

Submission status: Wrong Answer

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

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

    if x<min:
        min = x
print(min)

Submission status: Wrong Answer

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


ma=0
for i in range(len(s)):
  cnt=0
  now=s[i:i+len(t)]

  
  for j in range(len(now)):
    if now[j]==t[j]:
      cnt+=1
  ma=max(cnt,ma)
print(len(t)-ma)

Submission status: Wrong Answer

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

max_count = 0
for start_t in range(len(T)):
    for start_s in range(start_t, len(S)):
        if len(S) - start_s < len(T) - start_t:
            break
        if T[start_t] == S[start_s]:
            count = 0

            for i in range(len(T) - start_t -1):
                if T[start_t+i] == S[start_s+i]:
                    count += 1
            
            max_count = max(max_count, count)

answer = len(T) - max_count
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
ans = float('inf')
for i2 in range(len(T)):
    if i2 + len(T) > len(S):
        break
    ans = min(ans, sum(S[i1] != T[i1 - i2] for i1 in range(i2, i2 + len(T))))
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
n = len(s)
l = len(t)
ans = 0
tmp = 0
for i in range(n-l):
    for j in range(l):
        if s[i+j]==t[j]:
            tmp += 1 
    ans = max(ans,tmp)
    tmp = 0
print(l-ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if t in s:
    print(0)
else:
    n = len(s)
    l = len(t)
    ans = 0
    tmp = 0
    for i in range(n-l):
        for j in range(l):
            if s[i+j]==t[j]:
                tmp += 1 
        ans = max(ans,tmp)
        tmp = 0
    print(l-ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = len(t)
for idx in range(len(s)-len(t)):
    score = 0
    for idx2 in range(len(t)):
        if s[idx+idx2] != t[idx2]:
            score += 1
    ans = min(ans, score)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = float("inf")
for idx in range(len(s)-len(t)):
    score = 0
    for idx2 in range(len(t)):
        if s[idx+idx2] != t[idx2]:
            score += 1
    ans = min(ans, score)
print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(len(T)):
    for j in range(1, len(T)+1):
        if i >= j:
            continue

        if T[i:j] in S[i:len(S)-j]:
            ans = max(ans, j-i)

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

Submission status: Wrong Answer

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

ans = 0
for i in range(len(T)):
    for j in range(1, len(T)+1):
        if i >= j:
            continue

        if T[i:j] in S[i:j]:
            ans = max(ans, j-i)

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = 10**20
temp = 0

for start in range(0,slen-tlen):
    temp = 0
    for i in range(0,tlen):
        if t[i] != s[start+i]:
            temp += 1
    ans = min(ans,temp)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = 10**20
temp = 0
if t in s:
    print("0")
#答えが0以外の場合
else:
    for start in range(0,slen-tlen):
        for i in range(0,tlen):
            if t[i] != s[start+i]:
                temp += 1
        ans = min(ans,temp)
        temp = 0
    print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = 10**9
temp = 0
if t in s:
    print("0")
#答えが0以外の場合
else:
    for start in range(0,slen-tlen):
        for i in range(0,tlen):
            if t[i] != s[start+i]:
                temp += 1
        ans = min(ans,temp)
        temp = 0
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    cnt = float("inf")
    for i in range(len(S) - len(T)):
        tmp = 0
        for j in range(len(T)):
            if S[i + j] != T[j]:
                tmp += 1

        cnt = min(cnt, tmp)

    print(cnt)




if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = 10**9
temp = 0

for start in range(0,slen-tlen):
    for i in range(0,tlen):
        if t[i] != s[start+i]:
            temp += 1
    ans = min(ans,temp)
    temp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = 10000
temp = 0

for start in range(0,slen-tlen):
    for i in range(0,tlen):
        if t[i] != s[start+i]:
            temp += 1
    ans = min(ans,temp)
    temp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
slen = len(s)
tlen = len(t)
ans = tlen
temp = 0

for start in range(0,slen-tlen):
    for i in range(0,tlen):
        if t[i] != s[start+i]:
            temp += 1
    ans = min(ans,temp)
    temp = 0

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
lenS = len(S)
lenT = len(T)
maxcnt = 0
for l in range(lenT):
    for r in range(l,lenT):
        if T[l:r+1] in S[l:lenS-lenT+r+1]:
            maxcnt = max(maxcnt, r - l + 1)
print(lenT - maxcnt)

Submission status: Wrong Answer

Solution code:
import sys


def check(S, T):
    count = 0
    for s, t in zip(S, T):
        if s != t:
            count += 1
    return count


def main():
    S = input()
    T = input()
    dif = len(S) - len(T)
    ans = 10000
    for i in range(dif):
        compare = S[i: i+len(T)]
        count = check(compare, T)
        if count < ans:
            ans = count

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ans=float('inf')
for i in range(len(s)-len(t)):
  tmp=0
  for j in range(len(t)):
    if t[j]==s[i+j]:
      pass
    else:
      tmp+=1
  ans=min(ans,tmp)
print(ans)

Submission status: Wrong Answer

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

max_count = 0
for start_t in range(len(T)):
    for start_s in range(len(S)):
        for end_t in range(start_t+1, len(T)+1):
            for end_s in range(start_s+1, len(S)+1):
                if start_t > start_s or len(T)-end_t > len(S)-end_s:
                    break
                if T[start_t:end_t] in S[start_s:end_s]:
                    max_count = max(max_count, len(T[start_t:end_t]))

answer = len(T) - max_count
print(answer)

Submission status: Wrong Answer

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

max_count = 0
for start_t in range(len(T)):
    for start_s in range(len(S)):
        for end_t in range(start_t+1, len(T)+1):
            for end_s in range(start_s+1, len(S)+1):
                    if start_t > start_s:
                        break
                    if len(T)-end_t > len(S)-end_s:
                        break
                    if T[start_t:end_t] in S[start_s:end_s]:
                        max_count = max(max_count, len(T[start_t:end_t]))

answer = len(T) - max_count
print(answer)

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s = input()
t = input()

m = 0
for i in range(len(s)):
    tmp = 0
    for j in range(len(t)):
        if(j + i >= len(s)):
            break
        if(s[j + i] == t[j]):
            tmp += 1
    m = max(m, tmp)
print(len(t) - m)

Submission status: Wrong Answer

Solution code:
import sys, bisect, math, itertools, string, queue, copy
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

s = input()
t = input()

m = 0
for i in range(len(s)):
    tmp = 0
    for j in range(len(t)):
        if(j + i >= len(s)):
            break
        if(s[j + i] == t[j]):
            tmp += 1
        m = max(m, tmp)
print(len(t) - m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

max_count = 0
for start in range(len(T)):
    for end in range(start, len(T)):
        if T[start] == S[start]:
            if T[start:end+1] in S[start:-(len(T)-end)]:

                max_count = max(max_count, len(T[start:end+1]))

answer = len(T) - max_count
print(answer)

Submission status: Wrong Answer

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

z = len(S)-len(T)

res = []
cnt = 0
if z == 0:
  for a,b in zip(S,T):
    if a != b:
      cnt += 1
print(cnt);exit()
    
for i in range(z):
  s = S[i:i+len(T)]
  cnt = 0
  for j,k in zip(s,T):
    if j != k:
      cnt += 1
  res.append(cnt)

print(min(res))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

def main():
    input = sys.stdin.readline
    s = input().rstrip()
    t = input().rstrip()
    
    ans = float("INF")
    for start in range(len(s) - len(t)):
        cnt = 0
        for char in range(len(t)):
            if s[start + char] != t[char]:
                cnt += 1
        ans = min(ans, cnt)
    
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
S = input()
T = input()
if T in S:
  print(0)
  sys.exit(0)

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

Submission status: Wrong Answer

Solution code:
from numba import njit


@njit
def main():
    ans = 1000

    for i in [1, 2, 3]:
        ans += 1
    
    print(ans)
        
s = input()
t = input()    
main()

Submission status: Wrong Answer

Solution code:
a=str(input())
b=str(input())
ans=0
c=[]
l=0
for x in range(len(a)-len(b)+1):
    ans=0
    for i in range(len(b)):
       if a[i+l]!=b[i]:
           ans+=1
    l+=1
    c.append(ans)
print(c)
print(min(c))

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(x!=y for x,y in zip(s[i:]+'!'*1000,t[:-1]))for i in range(1000)))

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(x!=y for x,y in zip(s[i:]+'!'*999,t[:-1]))for i in range(999)))

Submission status: Wrong Answer

Solution code:
s=input()
a=len(s)
t=input()
b=len(t)
maxcnt=0
for i in range(a-b):
	count=0
	for j in range(b):
		s1=s[i+j]
		s2=t[j]
		if(s1==s2):
			count+=1
	if(maxcnt<count):
		maxcnt=count	
print(b-maxcnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
if t not in s:
    for i in range(len(t)):
        maxG = 0
        for l, j in zip(s[i:len(t)], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
    print(len(t)-maxi)
else:
    print("0")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
for i in range(len(s)):
    maxG = 0
    print(s[i:len(t)+i])
    if len(s[i:len(t)+i]) >= len(t):
        for l, j in zip(s[i:len(t)+i], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
    else:
        break
print(len(t)-maxi)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
for i in range(len(s)):
    maxG = 0
    print(s[i:len(t)+i])
    if len(s[i:len(t)+i]) >= len(t):
        for l, j in zip(s[i:len(t)+i], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
print(len(t)-maxi)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str, T: str):
    length = len(T)
    s_list =[]
    for i in range(len(S)-length+1):

        s = S[i:i+length]
        s_list.append(s)

    ans = length

    for s in s_list:
        counter = 0
        for i in range(ans):
            #print(T)
            if s[i] != T[i]:
                counter+=1

    ans = min(ans, counter)


    return print(ans)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    solve(S, T)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(S: str, T: str):
    length = len(T)
    s_list =[]
    for i in range(len(S)-length+1):

        s = S[i:i+length]
        s_list.append(s)

    ans = length

    for s in s_list:
        counter = 0
        for i in range(ans):
            print(T)
            if s[i] != T[i]:
                counter+=1

    ans = min(ans, counter)


    return print(ans)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    solve(S, T)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
T = list(input())
cmin = 1000

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

print(cmin)

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:]+'X'*999,t[:-1]))for i in range(len(s))))

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:]+s,t[:-1]))for i in range(len(s))))

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:]+t,t[:-1]))for i in range(len(s))))

Submission status: Wrong Answer

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

lens = len(s)
lent = len(t)

total = 100000000
for i in range(lens-lent):
    count = 0
    for j in range(lent):
        if s[i+j]!=t[j]:
            count+=1
    total = min(total,count)

if total == 100000000:
    print(lent)
else:
    print(total)

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:]+t,t))for i in range(len(s))))

Submission status: Wrong Answer

Solution code:
s=input()
a=len(s)
t=input()
b=len(t)
maxcnt=0
for i in range(a-b):
	count=0
	for j in range(b):
		s1=s[i+j]
		s2=t[j]
		if(s1==s2):
			count+=1
	if(maxcnt<count):
		maxcnt=count
print(b-maxcnt)

Submission status: Wrong Answer

Solution code:
s,t=open(0)
print(min(sum(a!=b for a,b in zip(s[i:],t))for i in range(len(s)-len(t)+1)))

Submission status: Wrong Answer

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

num=1000
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
    ans=min(num, cnt)
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = [x for x in input()]
T = [x for x in input()]
cmin = 1000
t = 0
for i in range(len(S)):
    c = 0
    t = i

    for j in range(len(T)):
        if t == len(S):
            exit()
        if S[t] != T[j]:
            c += 1
        else:
            if c < cmin:
                cmin = c
        t += 1
        
print(cmin)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
s = len(S)
t = len(T)
A=[0]*(len(S))
 
ans = t
for i in range(len(S)-len(T)):
  for j in range(len(T)):
    if S[i+j] != T[j]:
      A[i] += 1
  ans = min(ans, A[i])
 
#print(s)
#print(t)
#print(ANS)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline

S = input()
T = input()

result = float('inf')
for i in range(len(S) - len(T) + 1):
    t = 0
    for j in range(len(T)):
        if S[i + j] != T[j]:
            t += 1
    result = min(result, t)
print(result)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline
 
S = input()
T = input()
#A=[0]*(len(S))

ans = float('inf')
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
  ans = min(ans, x)

#print(s)
#print(t)
#print(A)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline
 
S = input()
T = input()
s = len(S)
t = len(T)
#A=[0]*(len(S))

ans = float('inf')
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
  ans = min(ans, x)

#print(s)
#print(t)
#print(A)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline
 
S = input()
T = input()
s = len(S)
t = len(T)
#A=[0]*(len(S))

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

#print(s)
#print(t)
#print(A)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline
 
S = input()
T = input()
s = len(S)
t = len(T)
A=[0]*(len(S))

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

#print(s)
#print(t)
#print(A)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
#input = sys.stdin.readline
 
S = input()
T = input()
s = len(S)
t = len(T)
A=[0]*(len(S))

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

#print(s)
#print(t)
#print(ANS)
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline
 
S = input()
T = input()
s = len(S)
t = len(T)
A=[0]*(len(S))

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

#print(s)
#print(t)
#print(ANS)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
list1 = list()
y = list()
for i in range(len(s)):
    if i < (len(s)-len(t)+1):
        list1.append(s[i:(i+len(t))])
print(list1)
for j in range(len(list1)):
    count = 0
    for k in range(len(t)):
        if list1[j][k] != t[k]:
            count = count + 1
    y.append(count)
print(min(y))

Submission status: Wrong Answer

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

ls = len(S)
lt = len(T)
ans = lt

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ls=len(s);lt=len(t)
ans=10000
for i in range(ls-lt):
    ss=list(s[i:i+lt])
    tt=list(t)
    
    tmp=[tt[j] for j in range(lt) if tt[j]!=ss[j]]
    ans=min(ans,len(tmp))
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
b=input()
c=999

for i in range(len(a)-len(b)+1):
  d=0
  for j in range(len(b)):
    if a[i+j]!=b[j]:
      d+=1
  if d<c:
    c=d
print(c)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
t_len = len(t)
ans = 0
for i in range(t_len):
  word = t[0:t_len-i]
  for j in range(len(s)-len(word)):
    if s[j:j+t_len-i]==word:
      print(i)
      exit(0)
else:
  print(t_len-1)

Submission status: Wrong Answer

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

N = len(T)

s_list = []
for i in range(len(S) - N + 1):
    s = S[i: i + N]
    s_list.append(s)

answer = N
for s in s_list:
    counter = 0
    for i in range(N):
        if s[i] != T[i]:
            counter += 1

answer = min(answer, counter)

print(answer)

Submission status: Wrong Answer

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

# ans = []
# for i in range(len(t)):
#     # print(t[i:])
#     # print(s[i:])
#     if t[i:] in s[i:]:
#         break
#     for j in range(1,len(t[i:])):
#         # print(t[i:][:-j])
#         # print(s[i:][:-j])
#         if t[i:][:-j] in s[i:][:-j]:
#             ans.append(i+j)
#             break
# if t in s:
#     print(0)
# elif len(ans) == 0:
#     print(len(t))
# else:
#     print(min(ans))
ans = len(t)
for i in range(len(s)-len(t)):
    dif = 0
    for j in range(len(t)):
        if t[j] != s[i:i+len(t)][j]:
            dif += 1
    ans = min(dif,ans)

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
A = len(T)  
ls = []
for i in range(len(S)-len(T)+1):
    ls.append(S[i:i+len(T)])
    
same = 0
for i in range(len(ls)):
    for j in range(len(T)):
        if T[j] == ls[i][j]:
            same += 1;
        if len(T)-same < A:
            A = len(T)-same
print(A)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
if t not in s:
    for i in range(len(s)):
        maxG = 0
        for l, j in zip(s[i:len(t)], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
    print(len(t)-maxi)
else:
    print("0")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
if t not in s:
    for i in range(len(t)):
        maxG = 0
        for l, j in zip(s[i:len(t)], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
    print(len(t)-maxi)
else:
    print("0")

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

ls = len(S)
lt = len(T)
ans = lt

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
match = 0
ans = 0
 
for n in range(len(S)-len(T)):
  match2 = 0
  U = S[n:n+len(T)]
  for m in range(len(T)):
    if U[m]==T[m]:
      match2+=1
  match = max(match,match2)
      
print(len(T)-match)

Submission status: Wrong Answer

Solution code:
from functools import reduce
s, t = input(), input()
ans = 10**9
for i in range(0, len(s) - len(t)):
    ans = min(ans, reduce(lambda x, a: x + (1 if a[0] != a[1] else 0), zip(s[i:], t), 0))
print(ans)

Submission status: Wrong Answer

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

L = 0
judge = False

ls = len(S)
lt = len(T)

ans = 0

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
if t not in s:
    for i in range(len(t)):
        maxG = 0
        for l, j in zip(s[i:len(t)+1], t):
            if l == j:
                maxG += 1
        maxi = max(maxi, maxG)
    print(len(t)-maxi)
else:
    print("0")

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
minCount = 100000000
i = 0
while i < len(s):
    countSame = 0
    j = 0
    while j < len(t) and i+j < len(s):
        if t[j] == s[i+j]:
            countSame += 1
        j += 1
        minCount = min(len(t) - countSame, minCount)
    i += 1
print(minCount)

Submission status: Wrong Answer

Solution code:
def main():
  s=input()
  t=input()
  ls=len(s)
  lt=len(t)
  r=0
  if ls==lt:
    for i in range(ls):
      if s[i]==t[i]:
        r+=1
    print(lt-r)
    exit()
  st= [ [ 0 for y in range(ls ) ] for x in range( lt ) ]
  for si in range(ls):
    for ti in range(lt):
      if s[si]==t[ti]:
        st[ti][si]=1
  r=0
  for si in range(ls-lt):
    rt=0
    for ti in range(lt-si):
      rt+=st[ti][(si+ti)]
    if r<rt:
      r=rt
  print(lt-r)
main()

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
maxi = 0 
for i in range(len(t)):
    maxG = 0
    for l, j in zip(s[i:len(t)], t):
        if l == j:
            maxG += 1
    maxi = max(maxi, maxG)
print(len(t)-maxi)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
minCount = len(t)
i = 0
while i < len(s):
    countDiff = 0
    j = 0
    while j < len(t) and i+j < len(s):
        if t[j] != s[i+j]:
            countDiff += 1
        j += 1
    minCount = min(countDiff, minCount)
    i += 1
print(minCount)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    s = input()
    t = input()
    if t in s:
        print(0)
        sys.exit()
    if len(s) == 1 and len(t) == 1:
        if t != s:
            print(1)
            sys.exit()
    lens = len(s)
    lent = len(t)
    res = set()
    for i1 in range(lens - lent):
        tmp1 = sum([c1 == c2 for c1, c2 in zip(t, s[i1:i1+lent])])
        res.add(lent - tmp1)

    if res:
        r = min(res)
        print(r)
    else:
        print(lent)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
minCount = 100000000
i = 0
while i < len(s):
    countSame = 0
    j = 0
    while j < len(t) and i+j < len(s):
        if t[j] == s[i+j]:
            countSame += 1
        j += 1
    minCount = min(len(t) - countSame, minCount)
    i += 1
if len(t) == 0:
  print(0)
print(minCount)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
minCount = len(t)
i = 0
while i < len(s):
    countDiff = 0
    j = 0
    while j < len(t) and i+j < len(s):
        if t[j] != s[i+j]:
            countDiff += 1
        j += 1
        minCount = min(countDiff, minCount)
    i += 1
print(minCount)