Save Olive
CodeChefOpen on judge ↗
Problem description. Bluto kidnaps olive again. Popeye has to save her and for that he needs spinach to gain strength to fight against Bluto. But there is a problem, there are ‘N’ Spinach cans placed together and they have different weights. Popeye can choose and carry only ‘M’ consecutive cans. Help popeye to choose the cans so that the sum of weights of the cans is maximum and he can attain max
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