Buggy python submission (verdict: Runtime Error):
import sys
import itertools
import numpy as np
input = sys.stdin.readline

N = int(input())
S = input()
cc = np.zeros(1000, dtype=np.int32)
ans = np.zeros(1000, dtype=np.int32)
for j in range(len(S)-1):
	p = int(S[j])
	for i in range(1000):
		if(p==i%10 and cc[i]==2):
			cc[i]+=1
			ans[i]=1
		elif(p==(i//10)%10 and cc[i]==1):
			cc[i]+=1
		elif(p==i//100 and cc[i]==0):
			cc[i]+=1
print(sum(ans))

Fixed submission:
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
cc = [0]*1000
ans = [0]*1000
for j in range(len(S)-1):
	p = int(S[j])
	for i in range(1000):
		if(p==i%10 and cc[i]==2):
			cc[i]+=1
			ans[i]=1
		elif(p==(i//10)%10 and cc[i]==1):
			cc[i]+=1
		elif(p==i//100 and cc[i]==0):
			cc[i]+=1
print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
vv = []
cc = [0] * 1000
for v in itertools.combinations(S[0:-1], 3):
	cc[int(v[0]+v[1]+v[2])]=1
print(sum(cc))

Fixed submission:
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
cc = [0]*1000
ans = [0]*1000
for j in range(len(S)-1):
	p = int(S[j])
	for i in range(1000):
		if(p==i%10 and cc[i]==2):
			cc[i]+=1
			ans[i]=1
		elif(p==(i//10)%10 and cc[i]==1):
			cc[i]+=1
		elif(p==i//100 and cc[i]==0):
			cc[i]+=1
print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
vv = []
cc = [False] * 1000
for v in itertools.combinations(S[0:-1], 3):
	cc[int(v[0]+v[1]+v[2])]=True
print(cc.count(True))


Fixed submission:
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
cc = [0]*1000
ans = [0]*1000
for j in range(len(S)-1):
	p = int(S[j])
	for i in range(1000):
		if(p==i%10 and cc[i]==2):
			cc[i]+=1
			ans[i]=1
		elif(p==(i//10)%10 and cc[i]==1):
			cc[i]+=1
		elif(p==i//100 and cc[i]==0):
			cc[i]+=1
print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()

vv = []
for v in itertools.combinations(S[0:-1], 3):
	vv.append(str(v))
print(len(list(set(vv))))


Fixed submission:
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
cc = [0]*1000
ans = [0]*1000
for j in range(len(S)-1):
	p = int(S[j])
	for i in range(1000):
		if(p==i%10 and cc[i]==2):
			cc[i]+=1
			ans[i]=1
		elif(p==(i//10)%10 and cc[i]==1):
			cc[i]+=1
		elif(p==i//100 and cc[i]==0):
			cc[i]+=1
print(sum(ans))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()

vv = []
for v in itertools.combinations(S[0:-1], 3):
	vv.append(str(v))
print(len(list(set(vv))))


Fixed submission:
import sys
import itertools
input = sys.stdin.readline

N = int(input())
S = input()
cc = [0]*1000
ans = [0]*1000
for j in range(len(S)-1):
	p = int(S[j])
	for i in range(1000):
		if(p==i%10 and cc[i]==2):
			cc[i]+=1
			ans[i]=1
		elif(p==(i//10)%10 and cc[i]==1):
			cc[i]+=1
		elif(p==i//100 and cc[i]==0):
			cc[i]+=1
print(sum(ans))