num.sort()
result = []
for i in range(len(num)2):
if i > 0 and num[i]==num[i1]:
pass
j = i + 1
k = len(num)1
while j < k:
sum = num[j] + num[k] + num[i]
if sum == 0:
result.append([num[i],num[j],num[k]])
j += 1
k = 1
# check duplicate
while j < k and num[j]==num[j1]:
j += 1
while j < k and num[k]==num[k+1]:
k = 1
elif sum < 0:
j += 1
else:
k = 1
return result
What is Output Limit Exceed Error?


hi, thank you so much for your help @illuz. In fact, I corrected this problem by using 'continue 'instead of 'pass' in the for loop. Thanks for your help anyway~