← All problemsSign in

Min Cost

Since, the Ustav festival is coming, Code_Yantra committee is busy in his work, So they decided he will give a Array set to the people to find the minimum cost. So, You have a given an array of numbers Ai which contains positive as well as negative numbers . The cost of the array can be defined as C(X) C(x)=|A1+T1|+|A2+T2|+........|An+Tn| , where T is the transfer array which contains N zeros ini

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