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 = [str(i) for i in input().split()]
 
s = list(S)
t = list(T)
s_n = len(s)
t_n = len(t)
n = 0
n = s_n - t_n + 1
min = t_n
 
for a in range(n):
  count = 0 
	for b in range(t_n):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
      
print(min)

S, T = [str(i) for i in input().split()]

s = list(S)
t = list(T)
s_n = len(S)
t_n = len(T)
n = 0
n = s_n - t_n + 1
min = t
 
for a in range(n):
  count = 0 
	for b in range(t_n):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
      
print(min)

S, T = input().split()
 
n = len(S) - len(T) + 1
min = len(T)
 
for a in range(n):
  count = 0 
	for b in range(len(T)):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
print(min)

s = input().split()

n = len(s[0]) - len(s[1]) + 1
min = len(s[1])
 
for a in range(n):
  count = 0 
	for b in range(len(s[1])):
      if s[0][a+b] != s[1][b]:
        count += 1
  if count < min:
    min = count
print(min)


x = input().split()
S = x[0]
T = x[1]
s = list(S)
t = list(T)
s_n = len(s)
t_n = len(t)
n = 0
n = s_n - t_n + 1
min = t_n
 
for a in range(n):
  count = 0 
	for b in range(t_n):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
print(min)


S, T = [str(i) for i in input().split()]
 
#s = list(S)
#t = list(T)
#s_n = len(s)
#t_n = len(t)
#n = 0
#n = s_n - t_n + 1
#min = t_n
 
#for a in range(n):
  #count = 0 
	#for b in range(t_n):
      #if S[a+b] != T[b]:
        #count += 1
  #if count < min:
    #min = count
      
#print(min)

x = input().split()
S = list(x[0])
T = list(x[1])
n = 0
n = len(S) - len(T) + 1
min = t
 
for a in range(n):
  count = 0 
	for b in range(len(T)):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
print(min)


x = input().split()
S = list(x[0])
T = list(x[1])
s = len(S)
t = len(T)
n = 0
n = s - t + 1
min = t
 
for a in range(n):
  count = 0 
	for b in range(t):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
print(min)


x = [input() for i in range(2)]
S = list(x[0])
T = list(x[1])
n = 0
n = len(S) - len(T) + 1
min = len(T)
 
for a in range(n):
  count = 0 
	for b in range(len(T)):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
print(min)

x = [input() for i in range(2)]
S = list(x[0])
T = list(x[1])

n = int(len(S)) - int(len(T)) + 1
min = int(len(T))
 
for a in range(n):
  count = 0 
	for b in range(int(len(T))):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
print(min)

S, T = [input() for i in range(2)]

s = list(S)
t = list(T)

n = len(s) - len(t) + 1
min = len(t)

for a in range(n):
  count = 0 
	for b in range(len(t)):
      if s[a+b] != t[b]:
        count += 1
  if count < min:
    min = count
      
print(min)

S, T = [str(i) for i in input().split()]
 
s = len(S)
t = len(T)
n = s - t + 1
min = t
 
for a in range(n):
  count = 0 
	for b in range(t):
      if S[a+b] != T[b]:
        count += 1
  if count < min:
    min = count
      
print(min)

S, T = input().split()
 
n = len(S) - len(T) + 1
moji = len(T)
 
for a in range(n):
  count = 0 
	for b in range(len(T)):
      if S[a+b] != T[b]:
        count += 1
  if count < moji:
    moji = count
    
print(moji)

S, T = input().split()
 
n = len(S) - len(T) + 1
moji = len(T)
 
for a in range(n):
  count = 0 
  for b in range(len(T)):
    if S[a+b] != T[b]:
      count += 1
  if count < moji:
    moji = count
    
print(moji)

x = [input() for i in range(2)]
S = x[0]
T = x[1]
moji = len(T)

for a in range(len(S) - len(T) + 1):
  count = 0
  for b in range(len(T)):
    
    if S[a+b] != T[b]:
      count += 1
  if count < moji:
    moji = count

print(moji)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted