Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[int(c) for c in input()]
count=0
for p in range(10):
    for q in range(10):
        for r in range(10):
            flag=False
                if p in s[:n-2]:
                    inp=s.index(p)
                    if q in s[inp+1:n-1]:
                        inq=s[inp+1:n-1].index(q)
                        if r in s[inq+1:n]:
                            count+=1
                            flag=True
                            break
                        if flag: break
                if flag: break
print(count)

Fixed submission:
N = int(input())
S = [int(c) for c in input()]

count = 0

for x100 in range(10):
    if x100 in S[:N-2]:
        ind_100 = S.index(x100)
        
        for x10 in range(10):
            if x10 in S[ind_100+1:N-1]:
                ind_10 = S[ind_100+1:N-1].index(x10) + ind_100 + 1
                
                for x1 in range(10):
                    if x1 in S[ind_10 + 1:]:
                        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=[int(c) for c in input()]
count=0
for p in range(10):
    for q in range(10):
        for r in range(10):
            flag=False
            for i in range(0,n-2):
                if p==s[i]:
                    for j in range(i+1,n-1):
                        if q==s[j]:
                            for k in range(j+1,n):
                                if r==s[k]: 
                                    count+=1
                                    flag=True
                                    break
                        if flag: break
                if flag: break
print(count)

Fixed submission:
N = int(input())
S = [int(c) for c in input()]

count = 0

for x100 in range(10):
    if x100 in S[:N-2]:
        ind_100 = S.index(x100)
        
        for x10 in range(10):
            if x10 in S[ind_100+1:N-1]:
                ind_10 = S[ind_100+1:N-1].index(x10) + ind_100 + 1
                
                for x1 in range(10):
                    if x1 in S[ind_10 + 1:]:
                        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
count=0
for p in range(10):
    for q in range(10):
        for r in range(10):
            flag=False
            for i in range(0,n-2):
                if p==int(s[i]):
                    for j in range(i+1,n-1):
                        if q==int(s[j]):
                            for k in range(j+1,n):
                                if r==int(s[k]): 
                                    count+=1
                                    flag=True
                                    break
                        if flag: break
                if flag: break
print(count)

Fixed submission:
N = int(input())
S = [int(c) for c in input()]

count = 0

for x100 in range(10):
    if x100 in S[:N-2]:
        ind_100 = S.index(x100)
        
        for x10 in range(10):
            if x10 in S[ind_100+1:N-1]:
                ind_10 = S[ind_100+1:N-1].index(x10) + ind_100 + 1
                
                for x1 in range(10):
                    if x1 in S[ind_10 + 1:]:
                        count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
s=input()
count=0
for p in range(10):
    for q in range(10):
        for r in range(10):
            flag=False
            for i in range(0,n-2):
                if p==int(s[i]):
                    for j in range(i+1,n-1):
                        if q==int(s[j]):
                            for k in range(j+1,n):
                                if r==int(s[k]): 
                                    count+=1
                                    flag=True
                                    break
                        if flag: break
                if flag: break
print(count)

Fixed submission:
N = int(input())
S = [int(c) for c in input()]

count = 0

for x100 in range(10):
    if x100 in S[:N-2]:
        ind_100 = S.index(x100)
        
        for x10 in range(10):
            if x10 in S[ind_100+1:N-1]:
                ind_10 = S[ind_100+1:N-1].index(x10) + ind_100 + 1
                
                for x1 in range(10):
                    if x1 in S[ind_10 + 1:]:
                        count += 1
print(count)