## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Xor Palindrome CodeChef Solution | CodeChef Problem Solution 2022

You are given a binary string $A$ of length $N$.

You can perform the following type of operation on the string $A$:

• Choose two different indices $i$ and $j$ $\left(1\le i,j\le N\right)$;
• Change ${A}_{i}$ and ${A}_{j}$ to ${A}_{i}\oplus {A}_{j}$. Here $\oplus$ represents the bitwise XOR operation.

Find the minimum number of operations required to convert the given string into a palindrome.

### Input Format

• First line of the input contains $T$, the number of test cases. Then the test cases follow.

## Xor Palindrome CodeChef Solution

• First line of each test case contains an integer $N$ denoting the size of the string.
• Second line of each test case contains a binary string $A$ of length $N$ containing $0$s and $1$s only.

### Output Format

For each test case, print the minimum number of operations required to make the string a palindrome.

### Constraints

• $1\le T\le 1000$
• $1\le N\le 2\cdot {10}^{5}$
• Sum of $N$ over all test cases does not exceeds $2\cdot {10}^{5}$.