store temp value for n as min ( f ( n - 1 ) , f ( n2 ) , f ( n3 ) ) + 1
res = getMinSteps ( n - 1 , memo ) NEW_LINE if ( n % 2 == 0 ) : NEW_LINE INDENT res = min ( res , getMinSteps ( n // 2 , memo ) ) NEW_LINE DEDENT if ( n % 3 == 0 ) : NEW_LINE INDENT res = min ( res , getMinSteps ( n // 3 , memo ) ) NEW_LINE DEDENT