## GUPTA MECHANICAL

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

## [Solution] Make all equal using Pairs Codechef Solution

Chef has an array $A$ of length $N$.

In one operation, Chef can choose any two distinct indices $i,j$ $\left(1\le i,j\le N,i\ne j\right)$ and either change ${A}_{i}$ to ${A}_{j}$ or change ${A}_{j}$ to ${A}_{i}$.

Find the minimum number of operations required to make all the elements of the array equal.

### Input Format

• First line will contain $T$, number of test cases. Then the test cases follow.
• First line of each test case consists of an integer $N$ - denoting the size of array $A$.
Solution Click Below:-  👉
👇👇👇👇👇

• Second line of each test case consists of $N$ space-separated integers ${A}_{1},{A}_{2},\dots ,{A}_{N}$ - denoting the array $A$.

### Output Format

For each test case, output the minimum number of operations required to

Fitness CodeChef Solution

Complementary Strand in a DNA CodeChef Solution

Make all equal using Pairs Codechef Solution

Count the ACs CodeChef Solution

Strong Elements CodeChef Solution

Reversal Sorting CodeChef Solution

AP Grid CodeChef Solution

Gcd and Lcm CodeChef Solution

The Subarray XOR CodeChef Solution

make all the elements equal.

### Constraints

• $1\le T\le 100$
• $2\le N\le 1000$