human
Find the minimum number of steps to reach M from N | Function to find a minimum number of steps to reach M from N.
Continue till m is greater than n.
If m is odd.
add one.
divide m by 2.
Return the required answer.
Driver code"
How can the above be solved in Python?
 Write me a code to find the minimum number of steps to reach M from N and the other steps required?
assistant
#Here is code to find the minimum number of steps to reach M from N and the other steps required.
 def Minsteps ( n , m ) :
	ans = 0
	while ( m > n ) :
		if ( m & 1 ) :
			m += 1
			ans += 1
		m //= 2
		ans += 1
	return ans + n - m
n = 4
m = 6
print ( Minsteps ( n , m ) )