Collect the Mangoes
CodeChefOpen on judge ↗
Jhethalal and Babita are playing with boxes of Ratnagiri Mangoes. They have a row $A$ of $N$ boxes of Mangoes. The $i$-th box has $A_i$ mango. The boxes are given to them in the order from the first box to the $N-th$ box. If a box has an even number of Mangoes, Jhethalal grabs the box. Otherwise, Babita grabs the box. Once a box is grabbed, the number of Mangoes in it gets added to the total numb
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