← All problemsSign in

Balanced and Unique Arrays

CodeChefRating 1431Open on judge ↗

For a positive, $\textbf{even}$ integer $N$, we call a pair of arrays $A$ and $B$ to be **interesting** if they satisfy the following conditions : - $|A| = |B| = N/2$ i.e. the length of array $A$ is equal to the length of array $B$. - Each integer from $1$ to $N$ occurs exactly once in exactly one of the arrays. - The $i^{th}$ prefix sum of $A$ is not equal to $i^{th}$ prefix sum of $B$ for all

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