Even Numbers Hate
Sushil has an array $A$ of $N$ integers - $A_1, A_2, ..., A_N$. He constructs a new array from it, the *prefix sum* array $P = [P_1, P_2, ..., P_N]$, where $P_i = A_1 + A_2 + ... + A_i$, i.e. the sum of the first $i$ elements. Sushil hates even numbers but he likes odd numbers, and thus wants to sure there are as many odd numbers as possible in the *prefix sum* array $P$. He is allowed to play wi
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