Back
Close
  • 29

What will I learn?

Mathematics

Statement

 Goal

You must output the smallest number greater than N with the same digit sum as N.
Input
An integer N.
Output
Required number.
Constraints
1 ≤ N ≤ 10^10
Example
Input
2
Output
11
Solve it

A higher resolution is required to access the IDE

codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants