My issue
can you explain this logic breffly
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main(String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int n = sc.nextInt();
int[] b = new int[n];
for (int i = 0; i < n; i++)
b[i] = sc.nextInt();
int count = 0;
if (n % 2 == 1) {
System.out.println("NO");
} else {
for (int i = 0; i < n; i++) {
if (b[i] == 1)
count++;
}
if (count % 2 == 0)
System.out.println("YES");
else
System.out.println("NO");
}
}
}
}
Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300A/problems/ADJSUMPAR