为什么我的代码AC UKE TLE全有
t=int(input())
times=0
def mex(m,a):
global times
mex_mex=[]
for i in a:
temp_a = a.copy()
del temp_a[a.index(i)]
small=min(temp_a)
if 0 not in temp_a or temp_a.count(0)==len(temp_a):
small=0
else:
while small in temp_a:
small+=1
mex_mex.append(small)
times+=1
if times>=m:
return mex_mex
else:
mex_mex=mex(m,mex_mex)
return mex_mex
for i in range(t):
n, m = map(int, input().split())
a = list(map(int, input().split()))
mex_mex=mex(m,a)
for c in mex_mex:
print(c,end=" ")
print("\n",end="")