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:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
import random
J=10**19
###############################################################################\n=17
s=input()
t=input()
ans=10**6
for i in range(len(s)-len(t)):
    count=0
    for j in range(len(t)):
        if s[i+j]==t[j]:
            count+=1
    ans=min(len(t)-count,ans)
print(ans)

Submission status: Wrong Answer

Solution code:
#akash mandal: jalpaiguri government engineering college
import sys,math

def ii(): return int(input())
def mii(): return map(int,input().split())
def lmii(): return list(mii())


def main():
    s=input();sd=s[::-1]
    t=input();td=t[::-1]
    d=[];r="";rd="";dd=[]
    for i in range(len(t)):
        r=r+t[i];
        #print(r)
        f=s.count(r)
        d.append(f)
    d.reverse()
    #print(*d)
    for i in range(len(td)):
        rd=rd+td[i]
        fd=sd.count(rd)
        dd.append(fd)
    #print(*dd)
    for i in range(len(d)):
        if d[i]!=0:
            d[i]=len(t)-(i+1)
        else:
            d[i]=len(t)
    for i in range(len(dd)):
        if dd[i]!=0:
            dd[i]=len(t)-(i+1)
        else:
            dd[i]=len(t)
    print(min(min(d),min(dd)))
    
    
    
        
        
                
                
            
        
            
    
        
if __name__=="__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
long_str = input()
short_str = input()
short_list = list(short_str)

long_len = len(long_str)
short_len = len(short_str)
iter_num = long_len - short_len + 1

print(short_str)

max_count = 0
for i in range(iter_num):
  tmp = 0
  obj_list = list(long_str[i:(short_len+i)])
  for s, o in zip(short_list, obj_list):
    tmp += int(s == o)
  max_count = max(max_count, tmp)

print(short_len - max_count)

Submission status: Wrong Answer

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

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


print(minimam)

Submission status: Wrong Answer

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

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


print(minimam)

Submission status: Wrong Answer

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


# Tが1文字のときlen(S)回、2文字のときlen(S) - 1回 …… なので、
# len(S) - len(T) + 1 回です
for i in range(len(S) - len(T) + 1):
    score = 0
    U = S[i:i + len(T)]  # Sのi文字目から連続するlen(T)文字を、Uとします
    for j in range(len(T)):
        if U[j] != T[j]:
            score += 1
print(score)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
if s.count(t):
    print(0)
else:
    len_t = len(t)
    cnt = 0
    for i in range(len(s) - len_t):
        c = 0
        for j in range(len_t):
            if s[i+j] == t[j]: c += 1
        cnt = max(cnt, c)
    print(len_t - cnt)

Submission status: Wrong Answer

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

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

    Nmax = min(diff, Nmax)

print(Nmax)

Submission status: Wrong Answer

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

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

    if (diff < Nmax):
        Nmax = diff

print(Nmax)

Submission status: Wrong Answer

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

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

print(Nmax)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
n = len(s)
m = len(t)
a,x = m,m
for i in range(n-m):
  x=m
  for j in range(m):
    x -= s[i+j] == t[j]
  a = min(a,x)
print(a)

Submission status: Wrong Answer

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

ans = len(t)

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

print(ans)

Submission status: Wrong Answer

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

ans = float('infinity')

for i in range(len(s)-len(t)):
    c = len(t)
    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("codefoces")
T=input("atcoder")
tlen = len(T)
 
 
for i in range(tlen, 1):
    for k in range(0, tlen+1-i):
        Tinclude = T[k:i]
        print(tlen-i)
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a = input()
b = input()
ind = []
for i in range(len(a)-len(b)):
  if a[i] == b[0]:
    ind.append(i)

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

print(ans)

Submission status: Wrong Answer

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

ans = 1000

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

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = len(t)
for i in range(len(s)-len(t)+1):
  # i は開始位置
  curr = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      curr+=1
  ans = max(curr, ans)
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import re
result_list = []
S = input()
T = list(input())
result = 0
for i in range(len(T)+1):
  for j in range(len(T)):
    if i+j<=len(T):
      temp_word = ''.join(T[j:j+i])
      if temp_word in S:
        result = len(T) - len(temp_word)
print(result)

Submission status: Wrong Answer

Solution code:
import re
result_list = []
S = input()
T = list(input())
result = 0
for i in range(len(T)):
  for j in range(len(T)):
    if i+j<=len(T):
        temp_word = ''.join(T[i:i+j])
        if temp_word in S:
          result = len(T) - len(temp_word)
print(result)

Submission status: Wrong Answer

Solution code:
S = str(input())
T = str(input())
lenS = len(S)
lenT = len(T)
max_match = 0
for idx in range(lenS - lenT + 1):
    cnt_match = 0
    for i in range(lenT - 1):
        if S[idx + i] == T[i]:
            cnt_match += 1
    if cnt_match > max_match:
        max_match = cnt_match
print(lenT - max_match)

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
ANS=[]
for start in range(len(S)):
  ans = 0
  for j in range(len(T)):
    if S[start] != T[j]:
      ans += 1
    ANS.append(ans)
print(min(ANS))

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
ANS=[]
for start in range(len(S)):
  ans = 0
  for j in range(len(T)):
    if S[start] != T[j]:
      ans += 1
  ANS.append(ans)
print(min(ANS))

Submission status: Wrong Answer

Solution code:


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    s = input()
    t = input()

    ans = len(s)

    for n in range(len(t)):
        if t[n] in s:
            if ans > len(t) - 1:
                ans = len(t) - 1

    for n in range(len(t)):
        if t[0:n] in s:
            if ans > len(t) - 1:
                ans = len(t) - n
    for n in reversed(range(len(t))):
        if t[n:len(t)-1] in s:
            if ans > len(t) - 1:
                ans = len(t) - n

    print(ans)

Submission status: Wrong Answer

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

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

print(len(t) - c)

Submission status: Wrong Answer

Solution code:
from sys import stdin
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]


s = str(input())
t = str(input())

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]


s = str(input())
t = str(input())

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

Submission status: Wrong Answer

Solution code:
S, T = [input() for x in range(2)]
lenT = len(T)
max_match_len = 0

for i in range(len(S)-lenT+1):
  compareS = S[i:i+lenT]
  print(compareS)
  match_len = 0
  for j in range(lenT):
    if compareS[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(lenT - max_match_len)

Submission status: Wrong Answer

Solution code:
S, T = [input() for x in range(2)]
lenT = len(T)
max_match_len = 0

for i in range(len(S)-lenT):
  compareS = S[i:i+lenT]
  match_len = 0
  print(compareS)
  for j in range(lenT):
    if compareS[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(len(T) - max_match_len)

Submission status: Wrong Answer

Solution code:
S, T = [input() for x in range(2)]
lenT = len(T)
max_match_len = 0
for i in range(len(S)-lenT):
  compareS = S[i:i+lenT+1]
  match_len = 0
  for j in range(lenT):
    if compareS[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(len(T) - max_match_len)

Submission status: Wrong Answer

Solution code:

S = input()
T = input()

count = 0
max_count = 0

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

print(len(T) - max_count)

Submission status: Wrong Answer

Solution code:

S = input()
T = input()

count = 0
max_count = 0

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

print(len(T) - max_count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = input()
T = input()

S_list = list(S)
S_len = len(S)
T_list = list(T)
T_len = len(T)


ans = len(T)


for i in range(len(S) - len(T)):
    diff = 0
    for t in range(len(T)):
        if T[t] != S[i + t]:
            diff += 1

    ans = min(ans, diff)

print(ans)

Submission status: Wrong Answer

Solution code:
S, T = [input() for x in range(2)]
max_match_len = 0

for i in range(len(S)):
  if len(S) - len(T) < i + 1:
    break
  compare_s = S[i:i+len(T)]
  match_len = 0
  for j in range(len(T)):
    if compare_s[j] == T[j]:
      match_len += 1
  else:
    if max_match_len < match_len:
      max_match_len = match_len
print(len(T) - max_match_len)

Submission status: Wrong Answer

Solution code:
list_data = [input() for _ in range(2)]

s = list_data[0]
t = list_data[1]

len_t = len(t)

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

print(len_t - max_correct)

Submission status: Wrong Answer

Solution code:
list_data = [input() for _ in range(2)]
print(list_data)

s = list_data[0]
t = list_data[1]

len_t = len(t)

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

print(len_t - max_correct)

Submission status: Wrong Answer

Solution code:
T, S = [input() for x in range(2)]
max_match_length = 0
for i in range(len(S)):
  if i == len(S) - 1 and max_match_length < 1:
    if S[i] in T[i:]:
      max_match_length = 1 
      break
  for j in range(i, len(S)):
    compare_s = S[i:j+1]
    match_len = len(compare_s)
    if match_len <= max_match_length:
      continue
    if compare_s in T[i:]:
      max_match_length = match_len

print(len(S) - max_match_length)

Submission status: Wrong Answer

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

maxx = 0
if s == t:
    print(0)
    quit()
for i in range(len(s) - len(t)):
    zzz = 0
    for j in range(len(t)):
        if s[i + j] == t[j]:
            zzz += 1

    if zzz > maxx:
        maxx = zzz

print(len(t) - maxx)

Submission status: Wrong Answer

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

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

minc = 1001

for i in range(sl):
    if i+tl-1 >= sl:
        break
    else:
        str1 = S[i:i+tl]
        count=0
        for j in range(tl):
            if str1[j] != T[j]:
                count+=1
        if count < minc:
            minc = count

print(count)

Submission status: Wrong Answer

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

mini = 10000000
for i in range(len(s) - len(t)):
    zzz = 0
    for j in range(len(t)):
        if not s[i + j] == t[j]:
            zzz += 1

    if zzz < mini:
        mini = zzz

if mini == 10000000:
    print(0)
else:
    print(mini)

Submission status: Wrong Answer

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

mini = 10000000
for i in range(len(s) - len(t)):
    zzz = 0
    for j in range(len(t)):
        if not s[i + j] == t[j]:
            zzz += 1

    if zzz < mini:
        mini = zzz

print(mini)

Submission status: Wrong Answer

Solution code:
S, T = [input() for i in range(2)]
ans = 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 += 1
    ans = min(ans, diff)

print(ans)

Submission status: Wrong Answer

Solution code:
S, T = [input() for i in range(2)]
ans = 0

for i in range(len(S)-len(T)):
    diff = 0

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

print(len(T)-ans)

Submission status: Wrong Answer

Solution code:
S = input()
T = input()
ans = 10000
for index in range(len(S)-len(T)):
  count = 0
  for x, y, in zip(S[index : index+len(T)], T):
    if x != y:
      count += 1
  if count < ans:
    ans = count;
print(ans)

Submission status: Wrong Answer

Solution code:
def match_count(s1, s2):
    count = 0
    result = 0
    for i, c in enumerate(s1):
        if c != s2[i]:
            if (count > result):
                result = count
            count = 0
        else:
            count += 1
    if (count > result):
        result = count
    return result

S = input()
T = input()

len_s = len(S)
len_t = len(T)
i = 0
max_match_num = -1

while (i <= len_s - len_t):
    sub_S = S[i:i+len_t]
    tmp = match_count(sub_S, T)
    if (tmp > max_match_num):
        max_match_num = tmp
    i += 1

print(len_t - max_match_num)

Submission status: Wrong Answer

Solution code:
def match_count(s1, s2):
    count = 0
    result = 0
    for i, c in enumerate(s1):
        if c != s2[i]:
            if (count > result):
                result = count
            count = 0
        else:
            count += 1
    return result

S = input()
T = input()

len_s = len(S)
len_t = len(T)
i = 0
max_match_num = -1

while (i <= len_s - len_t):
    sub_S = S[i:i+len_t]
    tmp = match_count(sub_S, T)
    if (tmp > max_match_num):
        max_match_num = tmp
    i += 1

print(len_t - max_match_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def match_count(s1, s2):
    count = 0
    result = 0
    for i, c in enumerate(s1):
        if c != s2[i]:
            count = 0
        else:
            count += 1
            if (count > result):
                result = count
    return result

S = input()
T = input()

len_s = len(S)
len_t = len(T)
i = 0
max_match_num = -1

while (i <= len_s - len_t):
    sub_S = S[i:i+len_t]
    tmp = match_count(sub_S, T)
    if (tmp > max_match_num):
        max_match_num = tmp
    i += 1

print(len_t - max_match_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
strS = input()
strT = input()

strS = list(strS)
strT = list(strT)

maxRange = 0
l = 0
while l <= (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] != strT[m]:
            count += 1
        m += 1
    if maxRange > count:
        maxRange = count
    l += 1

print(maxRange)

Submission status: Wrong Answer

Solution code:
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 not s[i+j] == t[j]:
			diff=diff+1
	print(diff)
	ans = min(ans, diff)
print(ans)

Submission status: Wrong Answer

Solution code:
strS = input()
strT = input()

maxRange = 0
l = 0
while l <= (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] != strT[m]:
            count += 1
        m += 1
    if maxRange > count:
        maxRange = count
    l += 1

print(maxRange)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
strS = input()
strT = input()

maxRange = 0
l = 0
while l < (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] == strT[m]:
            count += 1
        m += 1
    if maxRange < count:
        maxRange = count
    l += 1
print(len(strT)-maxRange)

Submission status: Wrong Answer

Solution code:
string1 = input()
string2 = input()

strS = list(string1)
strT = list(string2)

maxRange = 0
l = 0
while l < (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] == strT[m]:
            count += 1
        m += 1
    if maxRange < count:
        maxRange = count
    l += 1
print(len(strT)-maxRange)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = len(t)
#startが開始位置を決める
#jはtの長さ分sを探索するための変数
for start in range(len(s)-len(t)+1):
    l = 0
    for j in range(len(t)):
        if s[j+start] != t[j]:
            l += 1
        print(start,j)
    ans = min(ans,l)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = len(t)
#startが開始位置を決める
#jはtの長さ分sを探索するための変数
for start in range(len(s)-len(t)):
    l = 0
    for j in range(len(t)):
        if s[j+start] != t[j]:
            l += 1
    ans = min(ans,l)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = 10**4
#startが開始位置を決める
#jはtの長さ分sを探索するための変数
for start in range(len(s)-len(t)):
    l = 0
    for j in range(len(t)):
        if s[j+start] != t[j]:
            l += 1
    ans = min(ans,l)
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
t= input()
c=0
an = 10**8
for i in range(len(s)-len(t)):
    for j in range(i,i+len(t)):

        if s[j]!=t[j-i]:
            c+=1

    an = min(c,an)
    c=0

print(an)

Submission status: Wrong Answer

Solution code:
s = input()
t = input()
ans = 10**8
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:
s = input()
t = input()

sl = len(s)
tl = len(t)

ans = tl

for i in range(sl):
    if i < sl - tl:
        ss = s[i:i+tl]
        num = 0
        for j in range(tl):
            if ss[j] != t[j]:
                num += 1
        if num < ans:
            ans = num

print(ans)

Submission status: Wrong Answer

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

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

print(mindiff)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

ans = 10 ** 8
for i in range(len(s)-len(t)+1):
  check = 0
  for j in range(len(t)):
    print(s[i+j], t[j])
    if s[i+j] != t[j]:
      check = check + 1
  if ans > check:
    ans = check
print(ans)

Submission status: Wrong Answer

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

ans = 10 ** 8
for i in range(len(s)-len(t)):
  check = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      check = check + 1
  if ans > check:
    ans = check
print(ans)

Submission status: Wrong Answer

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

for idx in range(len(t), len(s)):
    tmp = 0
    for s_s, t_s in zip(list(s[idx-len(t):idx]), list(t)):
        if not s_s == t_s:
            tmp += 1
    if ans > tmp:
        ans = tmp

print(ans)

Submission status: Wrong Answer

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

ans = 1000
for start in range(len(S) - len(T)):
  diff = 0
  for i in range(len(T)):
    if not T[i] == S[start + i]:
      diff += 1
  ans = min(ans, diff)
print(ans)

Submission status: Wrong Answer

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

diff = 0
min_diff = len(t)

for cnt_s in range(0, len(s) - len(t)):
    diff = 0
    for cnt_t in range(0, len(t)):
        if s[cnt_s + cnt_t] != t[cnt_t]:
            diff += 1
    if min_diff > diff:
        min_diff = diff

print(min_diff)

Submission status: Wrong Answer

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

diff = 0
min_diff = len(t)

for start_t in range(len(t)):
    for cnt_s in range(len(s)):
        if t[start_t] == s[cnt_s] and len(t)-start_t < len(s)-cnt_s-start_t:
            diff = start_t
            for cnt_t in range(start_t, len(t)):
                if t[cnt_t] != s[cnt_s+cnt_t]:
                    diff += 1
            if min_diff > diff:
                min_diff = diff

print(min_diff)

Submission status: Wrong Answer

Solution code:
def count(s1,s2):
	cnt = 0
	for i in range(len(s2)):
		if s1[i] != s2[i]:
			cnt += 1
	return cnt 


S1 = input()
S2 = input()

mmin = len(S2)
for i in range(len(S1)-len(S2)):
	k = count(S2,S1[i:len(S2)+i])
	if k < mmin:
		mmin = k

print(mmin)

Submission status: Wrong Answer

Solution code:

def count(s1,s2):
	cnt = 0
	for i in range(len(s2)):
		if s1[i] != s2[i]:
			cnt += 1
	return cnt 


S1 = input()
S2 = input()

mmin = 99999999
for i in range(len(S1)-len(S2)):
	k = count(S2,S1[i:len(S2)+i])
	if k < mmin:
		mmin = k

print(mmin)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for j in range(len(T)+1,-1,-1):
    for i in range(len(T)+1-j):
        U=T[i:i+j]
        
        if U in S[i:len(S)-len(T)+j+i]:break
    else:continue
    break

print(len(T)-j)

Submission status: Wrong Answer

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

for j in range(len(T)+1,0,-1):
    for i in range(len(T)+1-j):
        U=T[i:i+j]
        if U in S[i:len(S)-len(T)+j+i]:break
    else:continue
    break

print(len(T)-j)

Submission status: Wrong Answer

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

if S.find(T) >= 0:
    print(0)
else:
    cnt = 1
    for _ in range(1, len(T)):
        for shift in range(cnt):
            # print(cnt, T[shift:shift - cnt])
            if S.find(T[shift:shift - cnt], cnt, len(S) - cnt) >= 0:
                print(cnt)
                exit()
        cnt += 1

    print(cnt)

Submission status: Wrong Answer

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

if S.find(T) >= 0:
    print(0)
else:
    cnt = 1
    for _ in range(1, len(T)):
        for shift in range(cnt):
            # print(cnt, T[shift:shift - cnt])
            if S.find(T[shift:shift - cnt], cnt) >= 0:
                print(cnt)
                exit()
        cnt += 1

    print(cnt)

Submission status: Wrong Answer

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

if S.find(T) >= 0:
    print(0)
else:
    cnt = 1
    for _ in range(1, len(T)):
        for shift in range(cnt):
            if S.find(T[shift:shift - cnt]) >= 0:
                print(cnt)
                exit()
        cnt += 1

    print(cnt)

Submission status: Wrong Answer

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

if S.find(T) >= 0:
    print(0)
else:
    cnt = 1
    for _ in range(1, len(T)):
        if S.find(T[cnt:]) >= 0:
            break
        if S.find(T[:-cnt]) >= 0:
            break
        cnt += 1

    print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

n = len(s)
m = len(t)
ans = m
for i in range(n-m):
  p = 1
  for j in range(i,m):
    if s[i+j] == t[j]: p += 1
    else: break
  if m-p < ans: ans = m-p
print(ans)

Submission status: Wrong Answer

Solution code:
# cording:utf-8

# 二つの文字列を入力
S = input()
T = input()

#出力する変数を定義
ans = len(T) # 最大値を定義しておく

# 全探索
# 何文字目から全探索するか
for start in range(len(S)-len(T)):
    diff = 0 # サイクルの最初でリセット

    # Tの文字数分探索
    for i in range(len(T)):

        # もし文字が違ったらカウント
        if T[i] != S[start + i]:
            diff = diff + 1

    # 結果を比較
    ans = min(ans, diff)

# 結果を出力
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 171 B
S = input()
T = input()
ans = []
for i in range(0, (len(S)-len(T) + 1)):
    tmp = 0
    #print(i)
    for j in range(0, len(T)):
        if T[j] != S[i +j]:
            tmp += 1
            print(S[i +j] + T[j])
        #print('tmp:' + str(tmp))
    ans.append(tmp)
        
print(min(ans))

Submission status: Wrong Answer

Solution code:
# 171 B
S = input()
T = input()
ans = []
for i in range(0, (len(S)-len(T) + 1)):
    if S[i] == T[0]:
        tmp = 0
        for j in range(1, len(T)):
            if T[j] != S[i + j]:
                tmp += 1
        ans.append(tmp)
        
print(min(ans)) if len(ans) != 0 else print(len(T))

Submission status: Wrong Answer

Solution code:
# 171 B
S = input()
T = input()
ans = []
tmp = 0
for i in range(0, (len(S)-len(T) + 1)):
    if S[i] == T[0]:
        for j in range(1, len(T)):
            if T[j] != S[i + j]:
                tmp += 1
        ans.append(tmp)
        
print(min(ans)) if len(ans) != 0 else print(len(T))