human
Minimum steps to minimize n as per given condition | function to calculate min steps.
base case.
store temp value for n as min ( f ( n - 1 ) , f ( n2 ) , f ( n3 ) ) + 1.
store memo [ n ] and return.
This function mainly initializes memo [ ] and calls getMinSteps ( n , memo ).
initialize memoized array.
driver program"
How can the above be solved in Python?

Give me a code to minimum steps to minimize n as per given condition and the other steps required?
assistant
#Here is code to minimum steps to minimize n as per given condition and the other steps required.
 def getMinSteps ( n , memo ) :
	if ( n == 1 ) :
		return 0
	if ( memo [ n ] != - 1 ) :
		return memo [ n ]
	res = getMinSteps ( n - 1 , memo )
	if ( n % 2 == 0 ) :
		res = min ( res , getMinSteps ( n // 2 , memo ) )
	if ( n % 3 == 0 ) :
		res = min ( res , getMinSteps ( n // 3 , memo ) )
	memo [ n ] = 1 + res
	return memo [ n ]
def getsMinSteps ( n ) :
	memo = [ 0 for i in range ( n + 1 ) ]
	for i in range ( n + 1 ) :
		memo [ i ] = - 1
	return getMinSteps ( n , memo )
n = 10
print ( getsMinSteps ( n ) )