MinAdd
Chef loves problems about digits and he came up with an interesting one. Chef has given you two integers $N$ and $K$. You should find the **minimum** non-negative integer $X$, such that $N + X$ has **at most** $K$ distinct digits in its decimal representation. For example, $1231$ has three distinct digits and $100$ has two distinct digits. ### Input - The first line of input will contain a sing
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