next number

Revision en2, by vaps2012000, 2021-02-01 13:50:45

how to find the next number which has all different digits and greater than the given number N? Like if N=2000 then the answer is 2013. how to approach this problem. where 1<=N<=10^16

Tags digit dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English vaps2012000 2021-02-01 13:50:45 21 Tiny change: 'this problom.' -> 'this problem.\nwhere 1<=N<=10^16'
en1 English vaps2012000 2021-02-01 13:48:18 178 Initial revision (published)