← All problemsSign in

Dividing coins

You have K coins (K is even), the ith coin is from countries[i]. You wish to distribute the coins among your two cousins equally ( both get K /2 coins). The elder cousin also loves to collect currency notes and coins from around the world so you want to give him the max amount of different coins. If the input is the countries spaced by single whitespace and represents coins from different countr

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