def check_fair(l):
if len(set(l[:3])) == len(set(l[3:])):
for i in range(3):
if l[:3].index(min(l[:3])) == l[3:].index(min(l[3:])):
l[:3].pop(l[:3].index(min(l[:3])))
l[3:].pop(l[3:].index(min(l[3:])))
else:
return "NOT FAIR"
return "FAIR"
else:
return "NOT FAIR"
check = list()
for i in range(int(input())):
l = list(map(int, input().split()))
check.append(check_fair(l))
print(*check, sep="\n")
I have read that already, but as you read the article, there can be various reasons for such an error.
What mistake have I done here?? I am unable to identify that !!!
Yes - it seems to trip up pretty much everyone at some point!
On Hackerrank it’s different - if you click “Run” without custom input, then it runs your code with the sample testcases as input. Not here on Codechef, though