← All problemsSign in

Gold Mine

Munchi works in a Gold Mine. As the conditions are very strange in gold mine, the cost of digging from every i-1 depth to i depth costs different. Maximum depth at which they can dig is N. Munchi is given the estimated cost of digging in form of array A. Here the ith number Ai denotes the cost of digging from i-1 depth to i depth. Munchi also knows that there are M Gold Bars at Depth Dj and of Va

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