Adjacent Sum Parity
Chef has an array $A$ of length $N$. Chef forms a binary array $B$ of length $N$ using the parity of the sums of adjacent elements in $A$. Formally, - $B_i = (A_i + A_{i+1}) \, \% \, 2$ for $1 \leq i \le N - 1$ - $B_N = (A_N + A_1) \, \% \, 2$ Here $x \, \% \, y$ denotes the remainder obtained when $x$ is divided by $y$. Chef lost the array $A$ and needs your help. Given array $B$, determine w
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