← All problemsSign in

STONES IN THE BUCKET

There are $N$ number bucket numbered from $0$ to $N-1$. Each bucket has $Ai$ number stones in it. John wants to make sure that every bucket have same number of stones. In one operation john can put one stone from a bucket to its left or right bucket. Find out how many operations do john need to make sure that every bucket have same numbers of stones. ###Input: - The first line contain s

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