CSA

Problem Of The Day

💻 Question:

Similar Pairs MEDIUM

Input Format:

t cases, n, array a.

Output Format:

YES if array can be partitioned into pairs that are both even/odd or have diff 1.

Example:

Input:
1
4
11 14 15 12

Output:
YES

Explanation:

TC1: (11,12) diff 1, (14,15) diff 1.