A - Chef Loves Chocolate Flavoured
CodeChefOpen on judge ↗
Our chef loves to eat chocolate-flavoured candies and from now onward he decides to eat them in a special manner. He takes an array of integers and decides to eat as many chocolates as the sum obtained by adding some (possibly none or all ) elements of the array. So you have to find the maximum possible sum in an array ( Also contains negative numbers. ) Note: You can take as many elements as
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