← All problemsSign in

Good Pairs

Srikant's daughter Dhriti loves good pairs. A good pair is a pair of numbers whose xor is even. Example : $(2,2)[xor = 0], (3,5)[xor = 6]$ are good pairs but $(2,3)[xor = 1], (4,7)[xor = 3]$ are not good pairs. Dhriti has an array $A$ of $N$ integers. She wants to find out number of ways she can choose two integers $i(1<=i<=N)$ and $j(i<=j<=N)$ such that the pair $(A_i , A_j)$ is a good pa

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start