My issue
My code
# cook your dish here
for i in range(int(input())):
odd=0
for i in range(int(input())):
a=int(input())
if a%2!=0:
odd+=1
print(odd)
Problem Link: MISSP Problem - CodeChef
# cook your dish here
for i in range(int(input())):
odd=0
for i in range(int(input())):
a=int(input())
if a%2!=0:
odd+=1
print(odd)
Problem Link: MISSP Problem - CodeChef
In this problem, we need to find which doll has no pair.
In your code, you are simply checking if a number is odd or not, which is not the correct approach.
We should check the frequency of each element in the list. If some element has a frequency of one, it will the required element.
Here is my code for reference.
# cook your dish here
for _ in range(int(input())):
n=int(input())
a=[]
for i in range(0,n):
a.append(int(input()))
for i in a:
if((a.count(i)%2)==1):
print(i)
break