Non-Negative Product
Alice has an array of $N$ integers — $A_1, A_2, \ldots, A_N$. She wants the product of all the elements of the array to be a non-negative integer. That is, it can be either $0$ or positive. But she doesn't want it to be negative. To do this, she is willing to remove some elements of the array. Determine the minimum number of elements that she will have to remove to make the product of the array'
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