Rishab and Pairs
CodeChefOpen on judge ↗
Rishabh is obsessed with pairing things, he has an array $A$ of $2$*$N$ elements and he wants to pair them all into $N$ pairs such that for each pair, the sum of elements is even. Being an artist he is busy, so he would like you to tell him whether he can pair these elements or not. Formally, for a pair ($Ai$ and $Aj$) $Ai+Aj$ must be even and each element must be present in exactly one pair. ##
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.
Sign in to chat with the tutor and save your progress.
Sign in to start