← All problemsSign in

The Gold Dilemma

Falling upon hard times and heavily inspired by heist movies, Chef decides to rob a bank. Evading all security, Chef has managed to break into the bank safe at night. However he his faced with a difficult choice. In the safe Chef finds N gold bars of the same size. Each bar has its value engraved on its face. The value of the ith bar is Vi. Naturally Chef wants to carry as much loot as possible,

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