Buggy python submission (verdict: Runtime Error):
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    temp=v[now]
                    if (now == 3):
                        # print(v)
                        break
            if (now == 3):
                ans += 1

print(ans)

Fixed submission:
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

#入力
N=int(input())
A = [int(x) for x in list(input())]
ans = 0

AA=[x for x in range(10)]


for i in AA:
    for j in AA:
        for k in AA:
            v=[i,j,k]
            now = 0
            for l in A:
                if (l == v[now]):
                    now += 1
                    if (now == 3):
                        #print(v)
                        break
            if (now == 3):
                ans += 1

print(ans)

Fixed submission:
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools

#入力
N=int(input())
A = [int(x) for x in list(input())]
ans = 0
num=[[0]*10 for _ range(10)]

for i,j,k in itertools.combinations(A, 3):
    if(num[i][j][k] == 0):
        num[i][j][k] =1
        ans += 1
        
print(ans)

Fixed submission:
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

#入力
N=int(input())
A = [int(x) for x in list(input())]
dict = {}

for i,j,k in itertools.combinations(A, 3):
    if(not((i,j,k) in dict)):
        dict[i,j,k]=1
#print(dict)
print(len(dict))

Fixed submission:
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)