← All problemsSign in

Rabbits and Carrots

Rabbits of chefland love to eat carrots, there N gardens numbered 1 to N in a row each ith garden has Ci carrots. Rabbits are very naughty and eat out all the carrots of continuous gardens. To save the carrots chef orders his farmers to analyze the garden beforehand. To do this farmers need your help. You have to store the value of total carrots in garden(s) of each possible continuous gardens in

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start