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:
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

Slen = len(S)
Tlen = len(T)
change_min = Tlen

for i in range(Slen - Tlen):
    diff = 0
    for j in range(Tlen):
        if S[i] != T[j]:
            diff += 1
    change_min = min(change_min,diff)

# 出力
print(change_min)

Submission status: Wrong Answer

Solution code:
s1,s2=input(),input()
s,ss,c,a=len(s2),len(s1),0,0
L=len(s2)

for i in range(L):
    k,a=0,a+1
    for j in range(L-a+1):
        if s2[k:k+a]in s1[k:]:
            c=L-a
            s=min(c,s)
        k+=1
        
        
        
print(s)

Submission status: Wrong Answer

Solution code:
s1,s2=input(),input()
s,ss,c,a=len(s2),len(s1),0,0
L=len(s2)

for i in range(L):
    k,a=0,a+1
    for j in range(L-a+1):
        if s2[k:k+a]in s1[j:]:
            c=L-a
            s=min(c,s)
            
        k+=1
        
        
        
print(s)

Submission status: Wrong Answer

Solution code:
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

k = len(S)
l = len(T)
change_min = l

for i in range(l):
    for m in range(l - i) :
        change = l
        for j in range(k - (l -i)+1):
            #print(S[j:j +l-i-m],T[m:l-i],change,l-i-m)
            if j >= m:
                if S[j:j +l-i-m] == T[m:l-i]:
                    change -= l-i-m
        if change_min > change:
            change_min = change
# 出力
print(change_min)

Submission status: Wrong Answer

Solution code:
s1,s2=input(),input()
s,c,a=len(s2),0,0
L=len(s2)

for i in range(L):
    k,a=0,a+1
    for j in range(L-a):   
        if s2[k:k+a]in s1:
            c=L-a
        k+=1
        s=min(c,s)
        
print(s)

Submission status: Wrong Answer

Solution code:
s1,s2=input(),input()
s,c=len(s2),0
L=len(s2)

for i in range(L):
    for j in range(i+1):
        k=0
        while k+j<=L:
            
            
            if s2[k:k+j]in s1:
                    c=L-j
           # print(k,k+j)
            k+=1
                
        s=min(c,s)
        
print(s)

Submission status: Wrong Answer

Solution code:
#B - Substring 
S = str(input())
T = str(input())
i = 0
j = 0

k = len(S)
l = len(T)
change_min = l

for i in range(l):
    for m in range(l - i) :
        change = l
        for j in range(k - (l -i)+1):
#            print(S[j+m:j +l-i],T[m:l-i],change,l-i-m)
            if S[j+m:j +l-i] == T[m:l-i]:
                change -= l-i-m
        if change_min > change:
            change_min = change
# 出力
print(change_min)

Submission status: Wrong Answer

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

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

max_char = lt

for i in range(0, ls - lt):
    s2 = s[i:i + lt]
    count = 0
    for cs, ct in zip(s2, t):
        if cs != ct:
            count += 1
    max_char = min(count, max_char)
print(max_char)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ans=1000
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:
s=input()
t=input()
ans=1000
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,len(t)-tmp)
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
ans=10000
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,len(t)-tmp)
print(ans)

Submission status: Wrong Answer

Solution code:
"""
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""


s = input()
t = input()
ans = len(t)

for i in range(len(s)-len(t)):
    cnt = 0
    for j in range(len(t)):
        if (t[j] != s[i+j]): cnt+=1
    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)):
    diff = 0
    for j in range(len(t)):
        if s[i+j]!=t[j]:
            diff+=1
    ans = min(diff,ans)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
S=[]
c=0
for i in range(len(s)):
    if s[i] in t:
        p=len(t)-1
        q=t.index(s[i])
        
        if q>i or i-q+p+1>len(s):
            pass
        else:
            s1=s[i-q:i+p-q+1]
                        
            count=0
            for j in range(len(s1)):
                if s1[j]!=t[j]:
                    count+=1
                    c+=1
                else:
                    pass
            S.append(count)
    else:
        pass
if c==0:
    print(len(t))
else:
    print(min(S))

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
S=[1001]
c=0
for i in range(len(s)):
    if s[i] in t:
        p=len(t)-1
        q=t.index(s[i])
        if q>i or i-q+p+1>len(s):
            pass
        else:
            s1=s[i-q:i+p-q+1]
            
            c+=1
            count=0
            for j in range(len(s1)):
                if s1[j]!=t[j]:
                    count+=1
                else:
                    pass
            S.append(count)
    else:
        pass
if c==0:
    print(len(t))
else:
    print(min(S))

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
t = input().rstrip()
count = 0
min_count = 10000
for i in range(len(s) - len(t)):
    s_selected = s[i:i + len(t)]
    count = 0
    for j in range(len(t)):
        if t[j] != s_selected[j]:
            count += 1
    #print(count)
    if count < min_count:
        min_count = count
print(min_count)

Submission status: Wrong Answer

Solution code:
s = input().rstrip()
t = input().rstrip()
count = 0
min_count = 1000
for i in range(len(s) - len(t)):
    s_selected = s[i:i + len(t)]
    count = 0
    for j in range(len(t)):
        if t[j] != s_selected[j]:
            count += 1
    #print(count)
    if count < min_count:
        min_count = count
print(min_count)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
T,S=len(t),len(s)

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

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 T[j] != S[i+j]:
            diff += 1
            
    ans = min(ans, diff)

print(ans)

Submission status: Wrong Answer

Solution code:
def solve(S, T):
    max_len = 0
    for i in range(len(T)):
        full = T[i:]
        for j in range(len(full)):
            search = full[:len(full) - j]
            target = S[i:len(S) - j]
            if search in target:
                max_len = max(max_len, len(search))
                break
    ans = len(T) - max_len
    print(ans)


if __name__ == "__main__":
    S = input()
    T = input()
    solve(S, T)

Submission status: Wrong Answer

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

ans = float('inf')

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

print (ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
T=input()
ans=int(len(T))
for i in range(int(len(S))-int(len(T))):
    x=int(len(T))
    for j in range(int(len(T))):
        if S[i+j]==T[j]:
            x-=1
        if j+1==int(len(T)):
            if ans>x:
                ans=x
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline
S = input().strip()
T = input().strip()

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

print(tmp)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

res = None
for i in range(len(s)-l):
    count = 0
    for j in range(l):
        if s[i+j] != t[j]:
            count +=1
    if res == None or res > count:
        res = count
        
print(res)

Submission status: Wrong Answer

Solution code:
S,T = input(),input()
r = len(T)

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

print(r)

Submission status: Wrong Answer

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

ans=10**9
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,len(t)-cnt)
print(ans)

Submission status: Wrong Answer

Solution code:
S, T = input(), input()
flag = 0
for i in range(len(T),0,-1):
    for j in range(len(T)-i+1):
        if T[j:i+j] in S and S.index(T[j:i+j])>=j and (len(S)-S.index(T[j:i+j]))>=(len(T)-j) :
            print(len(T)-i)
            flag = 1
            break
    if flag==1:
        break
else:
    print(len(T))

Submission status: Wrong Answer

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

ans = 0

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

print(len(t)-ans)

Submission status: Wrong Answer

Solution code:
S, T = input(), input()
flag = 0
for i in range(len(T),0,-1):
    for j in range(len(T)-i+1):
        if T[j:i+j] in S and S.index(T[j:i+j])>=j:
            print(len(T)-i)
            flag = 1
            break
    if flag==1:
        break

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

for i in range(0,lt):
  size = lt-i
  for j in range(0,lt-size+1):
    jps = (j+size)
    # 0 j (j+size) lt
    _t = t[j:jps]
    # print(i,j,size,_t, f'\t{s[j:ls-(lt-(j+size))]}')
    if _t in s[j:ls-(lt-(j+size))]:
      is_double = True
      break
  if is_double:
    print(i)
    break

if not is_double:
  print(lt)

Submission status: Wrong Answer

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

lt= len(t)
is_double = False
for i in range(lt):
  size = lt-i
  for j in range(0,i+1):
    _t = t[j:j+size]
    # print(i,j,size,_t, f'\t{s[j:]}')
    if _t in s[j:]:
      is_double = True
      break
  if is_double:
    print(i)
    break

if not is_double:
  print(lt)

Submission status: Wrong Answer

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

lt= len(t)
for i in range(lt):
  is_double = True
  size = lt-i
  for j in range(0,i+1):
    _t = t[j:j+size]
    # print(i,j,size,_t)
    if _t in s[j:]:
      is_double = False
      break
  if not is_double:
    print(i)
    break

Submission status: Wrong Answer

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

lt= len(t)
for i in range(lt):
  is_double = True
  size = lt-i
  for j in range(0,i+1):
    _t = t[j:j+size]
    # print(i,j,size,_t)
    if _t in s:
      is_double = False
      break
  if not is_double:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    s = input()
    t = input()
    ans = len(t)
    for l in range(len(s)-len(t)):
        r = l+len(t)
        m = 0
        for i in range(len(t)):
            if t[i] != s[l+i]:
                m += 1
        if m < ans:ans = m
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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


def diff_count(a, b):
    c = 0
    for aa, bb in zip(a, b):
        if aa != bb:
            c += 1
    return c


min_d = len(t)

for i in range(len(s)-len(t)):
    ss = s[i:i + len(t)]
    d = diff_count(ss, t)
    if d < min_d:
        min_d = d

print(min_d)

Submission status: Wrong Answer

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


def diff_count(a, b):
    c = 0
    for aa, bb in zip(a, b):
        if aa != bb:
            c += 1
    return c


min_d = len(s)

for i in range(len(s)-len(t)):
    ss = s[i:i + len(t)]
    d = diff_count(ss, t)
    if d < min_d:
        min_d = d

print(min_d)

Submission status: Wrong Answer

Solution code:
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(cnt)

Submission status: Wrong Answer

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

T1= T
Tlist =[]
countfront = 0
countback = 0
while T not in S:
  #if T not in S:
   # print (T,S)
  Tlist = list(T)
  Tlist.pop(0)
  T ="".join(Tlist)
  T.lstrip()
  print (T)
  countfront+=1

Tlist = []
while T1 not in S:
  #if T1 not in S:
   # print (T1,S)
  Tlist = list(T1)
  Tlist.pop(0)
  T1 ="".join(Tlist)
  T1.lstrip()
  print (T1)
  countback+=1
  
if countfront>countback:
  print (countback)
else :
  print (countfront)

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    T = input()
    temp = ''
    for i in range(1, len(T)+1):
        print(T[0:i])
        if T[0:i] in S:
            temp = T[0:i]

    print(len(T)- len(temp))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# B
import sys
s = input()
t = input()
length = 0
ans = [0]*(len(s)-len(t)+1)
for i in range(len(s)-len(t)):
    for j in range(len(t)):
        if s[i+j] == t[j]:
            ans[i] += 1
print(len(t)-max(ans))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


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

    diff = len(S) - len(T)

    ans = len(T)

    for i in range(diff):
        tmp = 0
        for s, t in zip(S[i:len(T) + i], T):
            if s != t:
                tmp += 1
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def dif(s, t):
    count = 0
    for i in range(lt):
        if s[i] != t[i]:
            count += 1
    return count

if t in s: print(0)
else:
    ans = float('inf')
    for i in range(len(s)-lt):
        ans = min(ans, dif(s[i:i+lt], t))
    print(ans)

Submission status: Wrong Answer

Solution code:

def match1(str1, str2):
    match_count = 0
    for i in range(len(str1)):
        if str1[i] == str2[i]:
            match_count += 1

    return match_count

S = input()
T = input()

max_match = 0
for i in range(0, len(S) +1 -len(T)):
    subS = S[i:i+len(T)]
    max_match = max(max_match, match1(T, subS))
    print("{} {}".format(subS, T))
    if max_match == 0:
        for j in range(len(T)):
            if T[j] == subS[j]:
                max_match = 1

print(len(T)-max_match)

Submission status: Wrong Answer

Solution code:
def match1(str1, str2):
    match_count = 0
    one_match = 0
    for i in range(len(str1)):
        if str1[i] == str2[i]:
            match_count += 1

    return match_count

S = input()
T = input()

max_match = 0
for i in range(0, len(S)-len(T)):
    subS = S[i:i+len(T)+1]
    max_match = max(max_match, match1(T, subS))
    #print("{} {}".format(subS, T))
    if max_match == 0:
        for j in range(len(T)):
            if T[j] == subS[j]:
                max_match = 1

print(len(T)-max_match)

Submission status: Wrong Answer

Solution code:
S = input().strip()	 # novel
T = input().strip()  # substring

x = len(T)
ans = len(S)
for i in range(len(S) - x):
  U = S[i:i+x]
  cost = sum(1 if U[k] != T[k] else 0 for k in range(x))
  ans = min(ans, cost)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S, T = input(), input()
nT = len(T)
f = lambda a, b: sum(1 for x, y in zip(a, b) if x != y)
m = nT
for i in range(len(S) - nT):
    m = min(m, f(S[i:i+nT], T))
    if m == 0:
        break

print(m)

Submission status: Wrong Answer

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

answer = len(T)

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

        if T[j] != S[i + j]:
            diff += 1

    answer = min(answer, diff)

print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(len(t)-res)

Submission status: Wrong Answer

Solution code:
s=input();t=input();print(len(t)-max([sum([x==y for x,y in zip(s[i:],t)])for i in range(len(s))]))

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    t = input()
    ans = 1010
    
    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(cnt)
    return
    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    t = input()
    ans = 1e9
    
    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(cnt)
    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
S=len(s)
T=len(t)
count=0
ans=1000
for i in range(S-T):
  for j in range(T):
    if s[i+j]==t[j]:
      count+=1
    if T-count<ans:
      ans=T-count
    if j==T-1:
      count=0

print(ans)

Submission status: Wrong Answer

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

n = len(s)
m = len(t)

ans = 1000

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

print(ans)

Submission status: Wrong Answer

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    t = input()
    ans = 100000000
    
    for i in range(0,len(s)-len(t)+1):
        cnt = 0
        for j in range(len(t)):
        # for sub_s, sub_t in zip(s[i:len(t)+i],t):
            # if sub_s != sub_t:
            if s[i+j] != t[j]:
                cnt += 1
        if cnt < ans:
            ans = cnt
    print(cnt)
    

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s=list(input())
t=list(input())
S=len(s)
T=len(t)
count=0
ans=10**7
for i in range(S-T):
  for j in range(T):
    if s[i]==t[j]:
      count+=1
    if T-count<ans:
      ans=T-count
    if j==T-1:
      count=0
    i+=1

print(ans)

Submission status: Wrong Answer

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

stri = []
maxcount = 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
    maxcount = max(maxcount,count) 
print(len(t)-maxcount)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

len_T = len(T)
len_S = len(S)
output = 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
    output = min(output, diff)

print(output)

Submission status: Wrong Answer

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

len_T = len(T)
len_S = len(S)
output = 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
    output = min(output, diff)

print('output',output)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(minCount)

Submission status: Wrong Answer

Solution code:
s=input()
t=input()
n=len(s)-len(t)-1
ans=len(t)
for i in range(n):
    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()
a=len(T)
for i in range(len(T)):
  if T[i:] in S:
    a=i
    break
b=len(T)
for i in range(len(T)):
  if T[:len(T)-i] in S:
    b=i
    break
ans=min(a,b)
print(ans)

Submission status: Wrong Answer

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

Tlist =[]
count = 0
while T not in S:
  Tlist = list(T)
  Tlist.pop(0)
  T ="".join(Tlist)
  T.lstrip()
  count+=1
print (count)

Submission status: Wrong Answer

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


ans = len(t)
flag = False


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

    ans = min(ans, dif)

print(ans)

# for i in range(len(t)+1, 0, -1):
#    for j in range(0, len(t)-i+1):
#        sb = t[j:j+i]
#        if sb in s[j:]:
#            print(sb, s[j:])
#            ans = len(t)-len(sb)
#            flag = True
#            break
#
#    if flag:
#        break

Submission status: Wrong Answer

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


ans = len(t)
flag = False


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

    ans = min(ans, dif)

print(ans)

Submission status: Wrong Answer

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


ans = len(t)
flag = False


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

    ans = min(ans, dif)

print(ans)

# for i in range(len(t)+1, 0, -1):
#    for j in range(0, len(t)-i+1):
#        sb = t[j:j+i]
#        if sb in s[j:]:
#            print(sb, s[j:])
#            ans = len(t)-len(sb)
#            flag = True
#            break
#
#    if flag:
#        break


print(ans)

Submission status: Wrong Answer

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

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

ans=0

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

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:
S=input()
T=input()

ans=len(T)	#int

start=int(0)
k=int(0)

#Sの何文字目から調べるか全探索
for i in range(start,(len(S)-len(T))):
  start=start+1
  diff=0
  for j in range(k,len(T)):
    if T[j] != S[start+j]:
      diff=diff+1
      
  ans=min(ans,diff)

print(ans)

Submission status: Wrong Answer

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


s_len = len(s)
t_len = len(t)
ans = s_len
for i in range(0,s_len):
    tmp = 0
    for j in range(0,t_len):
        if i+j >= s_len:
            continue
        if s[i+j] != t[j]:
            tmp = tmp + 1
    ans = min(tmp,ans)

print(ans)

Submission status: Wrong Answer

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


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

print(ans)

Submission status: Wrong Answer

Solution code:
"""
#のコメントは解説のC++のどの部分かを示す
"""
S=list(input())	
T=list(input())

n=len(S)	#s.size()
m=len(T)	#t.size()
ans=m		#int ans=1e9
si=0
i2=0

for i in range(si, n-m):
  si=si+1
  diff=0
  for l in range(i2, m):
    if T[l] != S[si+l]:
      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)):
  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:
def func(S,T):
  tlen = len(T)
  min = 1000
  for x in range(0,len(S)-tlen,1):
    tmp = S[x:x+tlen]
    tmpNum = 0
    for i in range(0,len(tmp),1):
      if tmp[i] != T[i]:
        tmpNum += 1
    if min > tmpNum:
      min = tmpNum
  if min == 1000:
    min = tlen
  return min

if __name__ == "__main__":
    S = input()
    T = input()
    print(func(S,T))

Submission status: Wrong Answer

Solution code:
def func(S,T):
  tlen = len(T)
  min = 1000
  for x in range(0,len(S)-tlen,1):
    tmp = S[x:x+tlen]
    tmpNum = 0
    for i in range(0,len(tmp),1):
      if tmp[i] != T[i]:
        tmpNum += 1
    if min > tmpNum:
      min = tmpNum

  return min

if __name__ == "__main__":
    S = input()
    T = input()
    print(func(S,T))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = input()
t = input()
answer = 0
for start_i in range(len(s)-len(t)):
  compared_s = s[start_i:]
  index = 0
  matched_count = 0
  for t_s in t:
    if t_s == compared_s[index]:
      matched_count += 1
    index += 1
  if answer < matched_count:
    answer = matched_count

print(len(t)-answer)

Submission status: Wrong Answer

Solution code:
s = input()
len_s  = len(s)
t = input()
len_t = len(t)
q = []
for i in range(len_t - 1, 0, -1):
    for j in range(len_t-i+1):
        p = s.find(t[j:j+i])
        if p > -1:
            if p >= j and len_s - p >= len_t - j:
                s2 = s[p-j:p-j+len_t]
                ans = 0
                for k in range(len_t):
                    if s2[k] != t[k]:
                        ans += 1
                q.append(ans)
if len(q) > 0:
    print(min(q))
else:
    print(len_t)

Submission status: Wrong Answer

Solution code:
s = input()
len_s  = len(s)
t = input()
len_t = len(t)
for i in range(len_t - 1, 0, -1):
    for j in range(len_t-i+1):
        p = s.find(t[j:j+i])
        if p > -1:
            if p >= j and len_s - p >= len_t - j:
                s2 = s[p-j:p-j+len_t]
                ans = 0
                for k in range(len_t):
                    if s2[k] != t[k]:
                        ans += 1
                print(ans)
                exit()
print(len_t)

Submission status: Wrong Answer

Solution code:
a = input()
b= input()
c=b[0]
count=0
for i in range (1,len(b)):
    if c in a:
        count += 1
    c += b[i]
    if count != 0:
        print(len(b)-count)
if count == 0:
    c=a[0]
    for i in range (1,len(a)):
        if c in b:
            count += 1
        c += a[i]
    print(len(a)-count)