Problem Link: ZOOZ Problem - CodeChef
Feedback
I wanted to know the reason why my code fails in submission.It works for all test custom inputs with the correct result which is aimed for in the question.
Question:
Zero Ones Equal One Zeros
My code:
for i in range(int(input())):
n=int(input())
a=“010”
b=“1001”
odd=‘10’
even=‘01’
if n==3:
print(a)
elif n==4:
print(b)
elif n%2==0 and n>4:
c=n-4
print(str(b+str((c//2)*even)))
elif n%2!=0 and n>3:
c=n-3
print(str(a+str((c//2)*odd)))