← All problemsSign in

Gift for twins

Uncle Charlie decided to suprise twins Alice and Bob on their birthday. He have to buy gifts for their birthday.Every gift has a value denoting its beauty. To be impartial to twins, he have to minimise the absolute difference of the beauty(denoted by B) of gifts. Charlie have to select two gifts from the given N gifts in store.Print the minimum possible absolute difference of gifts selected by Cha

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