FFL April Lunchtime

I would like to know why my code didnt work for FFL
https://www.codechef.com/viewsolution/32238290

try:
    for _ in range(int(input())):
        n,s=map(int,input().split())
        p=list(map(int,input().split()))
        r=list(map(int,input().split()))

        deff=[]
        forw=[]
        for i in range(len(r)):
            if (r[i]==0):
                deff.append(p[i])
            else:
                forw.append(p[i])

        if (min(deff)+min(forw)+s<=100):
            print ('yes')
        else:
            print('no')
except:
    pass

n could be 1 also

if there is only one value or one type of player then this code will give WA

1
1 90
3
0

check for this testcase

Your error is to enclose this whole thing in a try-except block. When one of the arrays deff or forw is empty, your code will go into the except block ( as min of an empty array is not defined ) instead and not print anything.

Adding a print("no") to your except block should give correct answer.

Thank you @psaini72 and @tannatsri.
Now Ive learned to use list properly. This mistake plummeted my rating. I’ll be back for sure.