Number Formation
CodeChefOpen on judge ↗
The task is simple! You have to form a given number n using following two operations. - Append a digit d to current number. The cost of this operation is d (0zero You start the process with an empty number and repeat one of the above 2 operations until you get the desired number. Print the minimum cost to form the given number. Input First line will contain T (the number of test cases). For
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