The Program must accept an integer N. The program must print all the stepping number from 10 to N, if there is no such number present the program should print -1 as
Since I can't comment yet. I will explain the idea of Nick's algorithm here.
Create 1-digit number list [1,2,3,4,5,6,7,8,9]
Create 2-digit number list by combining number k
in 1-digit number list with k*10 + (k-1) or k*10 + (k+1), for example 3
will generate 32
or 34
m
is calculated before.