← All problemsSign in

Grump and Wall

A president of a huge country built a wall around the country. The bricks are stacked one on top of the other in N columns .The walls were built unevenly, each column has different number of bricks stacked in it. He wants to make it even. He has allocated a budget of D dollars to make the walls even. We can remove a brick or add a brick to a wall. There are infinite bricks available. Cost of remov

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