gender's blog

By gender, history, 2 years ago, In English

A number for which any two consecutive digits differ in absolute value by at most one is called a stepping number.

Find the kth stepping number greater that an integer N

The first line contains a long number N denoting the number from which we have to start finding our stepping number.

Constraints

N-> 10^18 K-> 10^18

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it