TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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`.

Submission attempts (in order):

S=input()
T=input()
check=[]
for i,tt in enumerate(T):
    check.append(0)
    for ss in S[i:-(len(T)-i)]:
        if ss==tt:
            check[i]+=1
# print(check)
print(len(T)-max(check))


S=input()
T=input()
check=[]
for i in range(len(S)-len(T)+1):
    check.append(0)
    for j,tt in enumerate(T):
        if tt==S[i+j]:
            check[i]+=1
# print(check)
check.append(0)
# print(check)
print(len(T)-max(check))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):

S = input()
T = input()

last = len(S) - len(T) + 1
ans = len(T)

for i in range(last):
    tent = 0
    for j in range(len(T)):
        if(S[i+j] != T[j]):
            tent += 1
    print(tent)
    if(tent < ans):
        ans = tent
print(ans)


S = input()
T = input()

last = len(S) - len(T) + 1
ans = len(T)

for i in range(last):
    tent = 0
    for j in range(len(T)):
        if(S[i+j] != T[j]):
            tent += 1
    if(tent < ans):
        ans = tent
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=str(input())
t=str(input())
l=0
for i in range(len(s)-len(t)+1):
    print(s[i:i+len(t)])
    p=0
    for j in range(len(t)):
        if t[j] == s[i:i+len(t)][j]:
            p+=1
    l=max(l,p)
print(len(t)-l)

s=str(input())
t=str(input())
l=0
for i in range(len(s)-len(t)+1):
    p=0
    for j in range(len(t)):
        if t[j] == s[i:i+len(t)][j]:
            p+=1
    l=max(l,p)
print(len(t)-l)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input("")
t = input("")
cnt = 0

ans = 10000

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

s = input("")
t = input("")

ans = 10000

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
t=input()
num=len(s)-len(t)
res=[]
for n1 in range(0,num+1):
    count=0
    for n2 in range(0,len(t)):
        if(t[n2]!=s[n1+n2]):
            count+=1
    print(count)
    res.append(count)
print(min(res))

s=input()
t=input()
num=len(s)-len(t)
res=[]
for n1 in range(0,num+1):
    count=0
    for n2 in range(0,len(t)):
        if(t[n2]!=s[n1+n2]):
            count+=1
    res.append(count)
print(min(res))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
T = input()

print(S)
print(T)

lens = len(S)
lent = len(T)

ans = 1000000

for i in range(lens - lent):
  count = 0
  for j in range(lent):
    if(S[i+j] != T[j]):
      count = count + 1

  if count < ans:
    ans = count
    
print(ans)


S = input()
T = input()

print(S)
print(T)

lens = len(S)
lent = len(T)

ans = 1000000

for i in range(lens - lent):
  count = 0
  for j in range(lent):
    if(S[i+j] != T[j]):
      count = count + 1

  if count < ans:
    ans = count
    
print(ans)

S = input()
T = input()

lens = len(S)
lent = len(T)

ans = lent

for i in range(lens - lent + 1):
  count = 0
  for j in range(lent):
    if S[i+j] != T[j]:
      count = count + 1

  if count < ans:
    ans = count
    
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)


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)


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)


s = input()
t = input()
maxi = 0 
for i in range(len(s)):
    maxG = 0
    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)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()

ans = 10000

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

print(ans)

s = input()
t = input()

ans = 10000

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

print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
a = input()
b = input()

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

a = input()
b = input()

T=1000

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
ans = 0
m0 = 10**9+7
for i in range(0,N-1):
    for j in range(i+1,N):
        ans = (ans + A[i]*A[j]) % m0
print(ans)

S = input().rstrip()
T = input().rstrip()
count = 0
lens = len(S)
lent = len(T)
for i in range(lens-lent+1):
    tempcount=0
    for j in range(lent):
        if S[i+j]==T[j]:
            tempcount += 1
    print(tempcount)
    count = max(count,tempcount)

print(lent-count)

S = input().rstrip()
T = input().rstrip()
count = 0
lens = len(S)
lent = len(T)
for i in range(lens-lent+1):
    tempcount=0
    for j in range(lent):
        if S[i+j]==T[j]:
            tempcount += 1
    #print(tempcount)
    count = max(count,tempcount)

print(lent-count)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(n):
  for j in range(i+1, n):
    b.append(a[i] % (10 ** 9 + 7) * (a[j] % (10 ** 9 + 7))
print(sum(b) % (10 ** 9 + 7))

s, t = [input() for i in range(2)]
c = []
for i in range(len(s) - len(t) + 1):
  d = len(t)
  for a, b in zip(s[i:], t):
    if a == b:
      d -= 1
  c.append(d)
print(min(c))

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()

cnt = 0

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

print(len(s) - cnt)

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()
s_len = len(s)
t_len = len(t)
ans = 1000
for i in range(s_len-t_len+1):
    cnt = 0
    for j in range(t_len):
        print(s[i+j])
        if s[i+j] != t[j]:
            cnt += 1
    ans = min(ans,cnt)
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()

s_len =len(s)
t_len =len(t)
count = 0



for i in range(s_len - t_len):
    for j in range(t_len):
        if s[i:t_len][j] != t[j]
            count += 1
    print(count)

s = input()
t = input()

s_len =len(s)
t_len =len(t)
count = 0
ans = []



for i in range(s_len - t_len + 1):
    for j in range(t_len):
        if s[i:t_len + i][j] != t[j]:
            count += 1
    ans.append(count)
    count = 0

min_ans = min(ans)
print(min_ans)



Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
from collections import deque
import sys, copy, itertools,heapq
input = sys.stdin.readline

S = input().rstrip()
T = input()
s=len(S)
t= len(T)
ANS=[0]*(len(S))

for i in range(len(S)-len(T)+1):
  for j in range(len(T)):
    if S[i+j] == T[j]:
      ANS[i] += 1

#print(ANS)
print(t-max(ANS))


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)


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(ANS)
print(ans)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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)


S = input()
T = input()

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

    Nmax = min(diff, Nmax)

print(Nmax)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)

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)

for i in range(len(S)-lenT+1):
  compareS = S[i:i+lenT]
  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)



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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
T=input()
k = len(T)
ans=k
lim=0
for i in range(len(S)-len(T)+1):
  for j in range(k):
    print( S[i+j],T[j])
    if S[i+j]==T[j]:
      lim+=1
  if lim<=ans:
    ans=len(T)-lim
  lim=0
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)


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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = list(input())
T = list(input())

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import itertools
s = input()
t = input()

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    print(part)
    if part in s:
        ans = len(part)
        
print(len(t) - ans)


import itertools
s = input()
t = input()

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    if part in s:
        ans = len(part)
        
print(len(t) - ans)


import itertools
s = input()
t = input()

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    if part in s:
        ans = len(part)
        
print(len(t) - ans)

s = input()
t = input()

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    print(part)
    if part in s:
        ans = len(part)
        
print(len(t) - ans)

s= input()
t = input()

count = len(t)

for i in range(len(s) - len(t) + 1):
    str_ = s[i:i + len(t)]
    temp = 0
    for i in range(len(str_)):
        #print(str_[i])
        if str_[i] != t[i]:
            temp += 1
    count = min(count, temp)    
        
print(count)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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)





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)





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)


strings = input().splitlines()




strS = list(strings[0])
strT = list(strings[1])

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)





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)





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(len(strT)-maxRange)


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import copy

s = input()
t = input()

sn = len(s)
tn = len(t)
answer = int(copy.deepcopy(tn))

for i in range(sn-tn+1):
    sk = s[i:i+tn]
    count = 0
    for j in range(tn):
        if sk[j] != t[j]:
            count += 1
    print(sk,count)
    if count < answer:
        answer = count

print(answer)

import copy

s = input()
t = input()

sn = len(s)
tn = len(t)
answer = int(copy.deepcopy(tn))

for i in range(sn-tn+1):
    sk = s[i:i+tn]
    count = 0
    for j in range(tn):
        if sk[j] != t[j]:
            count += 1
    if count < answer:
        answer = count

print(answer)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)











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)











S = input()
T = input()

answer = float('inf')
for s in range(len(S)):
    if len(S) - s < len(T):
        break
    count = 0
    for t in range(len(T)):

        if S[s+t] != T[t]:
            count += 1
            
    answer = min(answer, count)

print(answer)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


S=list(ns())
T=list(ns())

INF=10**9
ans=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
    ans=min(ans,tmp)

print(tmp)
            




import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


S=list(ns())
T=list(ns())

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

print(ans)
            




Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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)


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

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)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
T = input()

L = 0
judge = False

for i in range(len(T), 0, -1):
    # print(i)
    for j in range(len(T)-i+1):
        print(S[j:])
        if T[j:j+i] in S[j:]:
            L = i
            
            judge = True
            # print(i, j)
            break
    if judge:
        break

print(len(T)-L)


S = input()
T = input()

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

ans = ls

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


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()

res = 10000000000

for i in range(0, len(s)-len(t)+1):
    m = 0
    # print(s[i:], t)
    
    #     print(j,k)
    #     if j==k:
    #         m += 1
    for j in range(0, len(t)):
        # print(s[j], t[j])
        if(s[j]==t[j]):
            m+=1
            
    res = min(res, len(t)-m)
    # print(len(t)-m)

print(res)

s = input()
t = input()

res = 10000000000

for i in range(0, len(s)-len(t)+1):
    m = 0
    # print(s[i:], t)
    for j, k in zip(s[i:],t):
        # print(j,k)
        if j==k:
            m += 1
            
    res = min(res, len(t)-m)

if(res==10000000000):
    print(len(t))
else: 
    print(res)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
d,t,s = map(int,input().split())
if d <= s * t:
    print("Yes")
else:
    print("No")

s = input()
t = input()
ls = []
for i in range(len(s) - len(t) + 1):
    ls.append(s[i:i+len(t)])
now = 0
minimum = len(t)
for i in range(len(ls)):
    now = 0
    for j in range(len(t)):
        if t[j] == ls[i][j]:
            now += 1
    if len(t) - now < minimum:
        minimum = len(t) - now
print(minimum)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()

sl = len(s)
tl = len(t)
count = 0
for i in range(0,sl-tl+1):
    sb = s[i:i+tl]
    for j in range(tl):
        co = 0
        if sb[j] == t[j]:
            co += 1
    if co > count:
        count = co

print(tl - count)


s = input()
t = input()

sl = len(s)
tl = len(t)
count = 0
for i in range(0,sl-tl+1):
    sb = s[i:i+tl]

    co = 0
    for j in range(tl):

        
        if sb[j] == t[j]:
            co += 1
    if co > count:
        count = co


print(tl - count)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import numpy as np
max_change = 1000
s = input()
t = input()
list_t = np.array([ _ for _ in t])
for i in range(1,len(s) - len(t) + 1):
    s_sample = s[i-1:len(t)+i-1]
    list_ss = np.array([ _ for _ in list_ss])
    list_tf = list_t == list_ss
    n_change = len(list_t) - sum(list_tf)
    if n_change < max_change:
        max_change = n_change
    else:
        pass
print(max_change)

import numpy as np
max_change = 1000
s = input()
t = input()
list_t = np.array([ _ for _ in t])
if len(s) == len(t):
    list_s = np.array([ _ for _ in s])
    list_tf = list_t == list_s
    n_change = len(list_t) - sum(list_tf)
    if n_change < max_change:
        max_change = n_change
    else:
        pass
else:
    for i in range(1,len(s) - len(t) + 1):
        s_sample = s[i-1:len(t)+i-1]
        list_ss = np.array([ _ for _ in s_sample])
        list_tf = list_t == list_ss
        n_change = len(list_t) - sum(list_tf)
        if n_change < max_change:
            max_change = n_change
        else:
            pass
print(max_change)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
T=input()

ans=10000

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

print(ans)

S=input()
T=input()

ans=10000

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

print(ans)  

S=input()
T=input()

ans=10000

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

print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = list(input())
t = list(input())

ln = len(s)
lt = len(t)
n = ls - lt + 1
l = []

cnt = 0
for i in range(n):
    for j in range(lt):
        if t[j] != s[i + j]:
            cnt += 1
    l.append(cnt)
    cnt = 0
    
print(min(l))
        

s = list(input())
t = list(input())

ls = len(s)
lt = len(t)
n = ls - lt + 1
l = []

cnt = 0
for i in range(n):
    for j in range(lt):
        if t[j] != s[i + j]:
            cnt += 1
    l.append(cnt)
    cnt = 0
    
print(min(l))

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s=list(input())
t=list(input())
S=[0 for i in range(len(s)-len(t)+1)]
for i in range(len(s)-len(t)+1):
  for j in range(len(t)):
    if t[j]==s[j+i]:
      S[i]+=1

S_max=max(S)
print(t-S_max)

s=list(input())
t=list(input())
S=[0 for i in range(len(s)-len(t)+1)]
for i in range(len(s)-len(t)+1):
  for j in range(len(t)):
    if t[j]==s[j+i]:
      S[i]+=1
      
S_0=max(S)
print(len(t)-S_0)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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)

s = input()
t = input()

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
T=input()

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

S=input()
T=input()

best_num_char=0
for i in range(len(S)-len(T)+1):
    # print(T[i:])
    num_char=0
    for j in range(len(T)):
        num_char+=1 if S[i+j]==T[j] else 0
        # print(num_char,S[i + j])
    if best_num_char<num_char:
        best_num_char=num_char

# print(len(T))
print(len(T)-best_num_char)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
T = input()

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

if T in S:
    ans = 0
else:
    minimum = len(T)
    for i in range(iteration):
        s = S[i:len(T)+i]
        for j in range(len(T)):
            count = 0
            if s[j] != T[j]:
                count += 1
        minimum = min(minimum, count)
    ans = minimum
    
print(ans)

S = input()
T = input()

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

if T in S:
    ans = 0
else:
    minimum = len(T)
    for i in range(iteration):
#         print('---------------')
        s = S[i:len(T)+i]
#         print(s)
#         print(T)
        count = 0
        for j in range(len(T)):
            if s[j] != T[j]:
                count += 1
#             print(count)
        minimum = min(minimum, count)
    ans = minimum
    
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import re

s = input()
t = input()
cnt = -1
for i in range(len(t) + 1):
    cnt += 1
    f = "\S{" + str(i) +"}" + t[(i):len(t)]
    b = t[0:len(t) - i] + "\S{" + str(i) + "}"
    if re.search(f, s):
        print("in")
        break
    elif re.search(b, s):
        print("in")
        break

print(cnt)


s = input()
t = input()

ans = len(t)

for i in range(len(s) - (len(t) - 1)):
    cnt = len(t)
    for j in range(len(t)):
        if s[i + j] == t[j]:
            cnt -= 1
    if cnt < ans:
        ans = cnt

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
T=input()
import re

def x():
    for i in range(len(T),0,-1): 
        for j in range(len(T)-i): 
            t=T[j:i+j]
            for m in re.finditer(t, S):
                p=m.start()
                if p!=-1:
                    if j<=p and len(T)-j-1 <=len(S)-p-1:
                        return i
    return 0
print(len(T)-t)

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

ans=float('inf')
for i in range(0,ls-lt+1):
    ans=min(ans, sum([l!=m for l,m in zip(S[i:i+lt], T)]))
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys

s = input()
t = input()

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

print(finalans)


import sys

s = input()
t = input()

finalans = 1000000
for i in range(len(s) - len(t) + 1):
    ans = 0
    for j in range(len(t)):
        if (s[i+j] == t[j]):
            pass
        else:
            ans += 1
    finalans = min(finalans, ans)

print(finalans)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
def check(S,T,i):
	count=0
	for j in range(i,len(T)+i):
		if S[j] == T[j-i]:
			count+=1
	return count

S=input()
T=input()
b=[]
for i in range(0,len(S)-len(T)+1):
	b.append(check(S,T,i))
b.sort()
print(b[0])



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

S=input()
T=input()
b=[]
for i in range(0,len(S)-len(T)+1):
	b.append(check(S,T,i))
b.sort()
print(b[0])




Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = list(input())
t = list(input())
ans = len(t)

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

    ans = min(ans, tmp)

print(ans)


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

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

    ans = min(ans, tmp)

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
T = input()



match_cnt = 0

S = input()
T = input()

S_len = len(S)
T_len = len(T)

for S_idx in range(S_len - T_len + 1):
  cnt = 0

  for T_idx in range(T_len):
    if(S[S_idx + T_idx] == T[T_idx]):
      cnt += 1
  
  if( cnt > match_cnt ):
    match_cnt = cnt

print(T_len - match_cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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)  

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 += 1
    if c < c_1:
        c = c_1

print(len(t) - c)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
t=input()

print(s)
a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c):
  for j in range(b):
    if s[j]==t[i+j]:
      min2 += 1
  if min1>min2:
    min1 = min2
print(min1)

s=input()
t=input()

a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c+1):
  for j in range(b):
    
    if s[j+i]==t[j]:
      
      min2 += 1
  if min1<min2:
    min1 = min2
  min2 =0
print(b-min1)

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
T=input()

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

def f(s1,s2):
  print(s1, s2)
  r=0
  for i,j in zip(s1,s2):
    if i != j: r += 1
  return r

a=len(S)
for i in range(len(S)-len(T)+1):
  r = f(S[i:i+len(T)],T)
  if a > r: a = r

print(a)

S=input()
T=input()

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

def f(s1,s2):
  r=0
  for i,j in zip(s1,s2):
    if i != j: r += 1
  return r

a=len(S)
for i in range(len(S)-len(T)+1):
  r = f(S[i:i+len(T)],T)
  if a > r: a = r

print(a)

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s, t = input(), input()

ans = 0

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

if ans <= count:
  ans = count
print(len(t) - count)

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
T = input()

cand = []
for start in range(len(S) - len(T) + 1):
    print(S[start:start+len(T)])
    cnt = sum([not T[i] == S[start:start+len(T)][i] for i in range(len(T))])
    cand.append(cnt)

print(min(cand))


S = input()
T = input()

cand = []
for start in range(len(S) - len(T) + 1):
    cnt = sum([not T[i] == S[start:start+len(T)][i] for i in range(len(T))])
    cand.append(cnt)

print(min(cand))


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
t = input()
ans = len(t)
for i in range(len(s)-len(t)+1):
  
  curr = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      curr+=1
  ans = max(curr, ans)
  
print(ans)

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
T = input()


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

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

print(mindiff)





Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
T=input()
i=0
j=0
match = 0
for i in range(Len(S)-Len(T)):
  count = 0
  for j in range(Len(T)):
    if S[i+j]==T[j]:
      count=count+1
  
  if match<count:
    match=count

print(Len(T)-match)
      

S=input()
T=input()
i=0
j=0
match = 0
for i in Range(Len(S)-Len(T)):
  count = 0
  for j in Range(Len(T)):
    if S[i+j]==T[j]:
      count=count+1
  
  if match<count:
    match=count

print(Len(T)-match)
      
    

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

Verdicts: Runtime Error

Runtime Error

Accepted