Guest User

Untitled

a guest
Dec 28th, 2020
13
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let n = (parseInt(readline()) + 1).toString().split('').map(a => parseInt(a));
  2. for(let i = 0; i < n.length; i++) {
  3. while(n[i] > n[i+1]) n[i+1]++;
  4. }
  5. console.log(n.join(''));
RAW Paste Data