Chef and Diwali
CodeChefOpen on judge ↗
During Diwali, it's a tradition that each father gives his kids money which they can spend on entertainment. Chef has $N$ coins; let's denote the value of coin $i$ by $Vi$. Since it is Diwali, Chef is going to give one coin to each of his two children. He wants the absolute value of the difference between the values of coins given to the two children to be as small as possible, so that he would b
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.
Sign in to chat with the tutor and save your progress.
Sign in to start