← All problemsSign in

CHOCOLATE BOXES

There are N boxes and in ith box there are C[i] chocolates of same flavour and flavour of chocolates in every ith box are different, now the cost for removing or add one chocolate in i th box of that flavour is F[ i ], now Joe want to equalize all the chocolates in all boxes. Find the minimum cost to make all chocolates equal in every box. formally, find minimum cost for make C[1] = C[2] =

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