human
Stepping Numbers | Prints all stepping numbers reachable from num and in range [ n , m ].
Queue will contain all the stepping Numbers.
Get the front element and pop from the queue.
If the Stepping Number is in the range [ n , m ] then display.
If Stepping Number is 0 or greater than m , no need to explore the neighbors.
Get the last digit of the currently visited Stepping Number.
There can be 2 cases either digit to be appended is lastDigit + 1 or lastDigit - 1.
If lastDigit is 0 then only possible digit after 0 can be 1 for a Stepping Number.
If lastDigit is 9 then only possible digit after 9 can be 8 for a Stepping Number.
Prints all stepping numbers in range [ n , m ] using BFS ..
For every single digit Number ' i ' find all the Stepping Numbers starting with i.
Driver code.
Display Stepping Numbers in the range [ n , m ]"
Solution in Python:

What is a code to stepping Numbers and the other steps required?
assistant
#Here is code to stepping Numbers and the other steps required.
 def bfs ( n , m , num ) :
	q = [ ]
	q . append ( num )
	while len ( q ) > 0 :
		stepNum = q [ 0 ]
		q . pop ( 0 ) ;
		if ( stepNum <= m and stepNum >= n ) :
			print ( stepNum , end = " ▁ " )
		if ( num == 0 or stepNum > m ) :
			continue
		lastDigit = stepNum % 10
		stepNumA = stepNum * 10 + ( lastDigit - 1 )
		stepNumB = stepNum * 10 + ( lastDigit + 1 )
		if ( lastDigit == 0 ) :
			q . append ( stepNumB )
		elif ( lastDigit == 9 ) :
			q . append ( stepNumA )
		else :
			q . append ( stepNumA )
			q . append ( stepNumB )
def displaySteppingNumbers ( n , m ) :
	for i in range ( 10 ) :
		bfs ( n , m , i )
n , m = 0 , 21
displaySteppingNumbers ( n , m )