Mr X and his love for numbers
CodeChefOpen on judge ↗
Mr. X is very fond of numbers. Mr. B decides to test his love for numbers by giving him an array of 10 numbers and asking him the number which has the highest weight. The weight of a number is the sum of distinct digits of the number. For example 27 has weight 2+7=9 and 131 has weight 1+3=4. Help Mr. A in proving his love for numbers. Input The first line inputs a number T, i.e., the number of
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