TLE error in python

def meal(d,z):
count=0
if(n==1):
q=list(set(d[0]))
q.sort()
if(q==z):
count=1
else:
for a in range(n):
for b in range(a+1,n):
y=list(set(d[a]+d[b]))
y.sort()
if(y==z):
count=count+1
print(count)

t=int(input())
for a in range(t):
n=int(input())
z=[‘a’,‘e’,‘i’,‘o’,‘u’]
d=[[]]*n
for b in range(n):
p=input()
p=list§
p=list(set§)
d[b]=p
meal(d,z)

Asking questions related to ongoing contests are not allowed, delete this question, if someone copy pasted your sol, both of you will receive a massive penalty in your rating and Codechef can even ban you for this.
Try to do this question by yourself till contest gets over.

1 Like