Buggy python submission (verdict: Runtime Error):
li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]

D = list(map(int,input().split()))


minvalue=N
temp=0

for i in range(10*N):
    i=i+N
    numtemp=i
    num_4=int(i/10000)
    i=i-10000*num_4
    num_3=int(i/1000)
    i=i-1000*num_3
    num_2=int(i/100)
    i=i-100*num_2
    num_1=int(i/10)
    i=i-10*num_1
    num_0=i
    
    for j in range(K):
        if (num_0!=D[j])and(num_1!=D[j])and(num_2!=D[j])and(num_3!=D[j])and(num_4!=D[j]):
            temp+=1
            
    if temp==K:
        num=numtemp
        break
    
    temp=0

print(num)
    

Fixed submission:
li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]

D = list(map(int,input().split()))


minvalue=N
temp=0

for i in range(10*N):
    i=i+N
    numtemp=i
    if numtemp>=10000:
        num_4=int(i/10000)
        i=i-10000*num_4
    else:
        num_4=10
        
    if numtemp>=1000:
        num_3=int(i/1000)
        i=i-1000*num_3
    else:
        num_3=10
        
    if numtemp>=100:
        num_2=int(i/100)
        i=i-100*num_2
    else:
        num_2=10
        
    if numtemp>=10:
        num_1=int(i/10)
        i=i-10*num_1
    else:
        num_1=10
        
    num_0=i
    
    for j in range(K):
        if (num_0!=D[j])and(num_1!=D[j])and(num_2!=D[j])and(num_3!=D[j])and(num_4!=D[j]):
            temp+=1
            
    if temp==K:
        num=numtemp
        break
    
    temp=0

print(num)

Buggy python submission (verdict: Runtime Error):
li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]

D = list(map(int,input().split()))


minvalue=N
temp=0

for i in range(10*(N+1)):
    i=i+N
    numtemp=i
    num_4=int(i/10000)
    i=i-10000*num_4
    num_3=int(i/1000)
    i=i-1000*num_3
    num_2=int(i/100)
    i=i-100*num_2
    num_1=int(i/10)
    i=i-10*num_1
    num_0=i
    
    for j in range(K):
        if (num_0!=D[j])and(num_1!=D[j])and(num_2!=D[j])and(num_3!=D[j]):
            if j==K-1:
                temp=1
        else:
            break
    if temp==1:
        num=numtemp
        break

print(num)
    

Fixed submission:
li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]

D = list(map(int,input().split()))


minvalue=N
temp=0

for i in range(10*N):
    i=i+N
    numtemp=i
    if numtemp>=10000:
        num_4=int(i/10000)
        i=i-10000*num_4
    else:
        num_4=10
        
    if numtemp>=1000:
        num_3=int(i/1000)
        i=i-1000*num_3
    else:
        num_3=10
        
    if numtemp>=100:
        num_2=int(i/100)
        i=i-100*num_2
    else:
        num_2=10
        
    if numtemp>=10:
        num_1=int(i/10)
        i=i-10*num_1
    else:
        num_1=10
        
    num_0=i
    
    for j in range(K):
        if (num_0!=D[j])and(num_1!=D[j])and(num_2!=D[j])and(num_3!=D[j])and(num_4!=D[j]):
            temp+=1
            
    if temp==K:
        num=numtemp
        break
    
    temp=0

print(num)

Buggy python submission (verdict: Runtime Error):

li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]

D = list(map(int,input().split()))


minvalue=N
temp=0

for i in range(N+1):
    i=i+N
    numtemp=i
    num_4=int(i/10000)
    i=i-10000*num_4
    num_3=int(i/1000)
    i=i-1000*num_3
    num_2=int(i/100)
    i=i-100*num_2
    num_1=int(i/10)
    i=i-10*num_1
    num_0=i
    
    for j in range(K):
        if (num_0!=D[j])and(num_1!=D[j])and(num_2!=D[j])and(num_3!=D[j]):
            if j==K-1:
                temp=1
        else:
            break
    if temp==1:
        num=numtemp
        break

print(num)
    

Fixed submission:
li_1 = list(map(int,input().split()))
N = li_1[0]
K = li_1[1]

D = list(map(int,input().split()))


minvalue=N
temp=0

for i in range(10*N):
    i=i+N
    numtemp=i
    if numtemp>=10000:
        num_4=int(i/10000)
        i=i-10000*num_4
    else:
        num_4=10
        
    if numtemp>=1000:
        num_3=int(i/1000)
        i=i-1000*num_3
    else:
        num_3=10
        
    if numtemp>=100:
        num_2=int(i/100)
        i=i-100*num_2
    else:
        num_2=10
        
    if numtemp>=10:
        num_1=int(i/10)
        i=i-10*num_1
    else:
        num_1=10
        
    num_0=i
    
    for j in range(K):
        if (num_0!=D[j])and(num_1!=D[j])and(num_2!=D[j])and(num_3!=D[j])and(num_4!=D[j]):
            temp+=1
            
    if temp==K:
        num=numtemp
        break
    
    temp=0

print(num)