for _ in range(T):
for i in range(len(nos)):
for j in llist:
if 0 not in nos:
if 1 not in nos:
please you indentation for your code
This is your solution: https://www.codechef.com/viewsolution/37290628
T=int(input()) for _ in range(T): //10-15 lines of logic if len(llist1)==1: if llist1%2!=0: print("Yes") break else: print("No") break
You have used a
break statement inside the if, do you know what really it does?
break statement terminates the loop containing it. Control of the program flows to the statement immediately after the body of the loop.
break statement is inside a nested loop (loop inside another loop), the
break statement will terminate the innermost loop.
so it will come out of the
for loop and stop.
Check for sample input and output in the question, your code doesn’t even pass that. try modifying it, remove
break and use
yes I changed it and it worked. Thank you. But still I am getting partially correct answer. I just removed the break statements.
Maybe you are going wrong with your logic.
check it once. !!