human
Smallest N digit number with none of its digits as its divisor | Function to calculate power.
Function to check if the N - digit number satisfies the given condition or not.
Getting the last digit.
Every number is divisible by 1 and dividing a number by 0 isn 't possible. Thus  numbers with 0 as a digit  must be discarded..
If any digit divides the number , return false.
If no digit divides the number , return true.
.
Function to find the smallest number not divisible by any of its digits ..
Get the lower range of n digit number.
Get the high range of n digit number.
check all the N - digit numbers.
If the first number to satify the constraints is found print it , set the flag value and break out of the loop ..
If no such digit found , return - 1 as per problem statement.
Driver code"
Solution in Python:
assistant
#Here is code to smallest N digit number with none of its digits as its divisor and the other steps required.
 def power ( a , b ) :
	if ( b == 0 ) :
		return 1 ;
	if ( b == 1 ) :
		return a ;
	tmp = power ( a , b // 2 ) ;
	result = tmp * tmp ;
	if ( b % 2 == 1 ) :
		result *= a ;
	return result ;
def check ( n ) :
	temp = n ;
	while ( temp > 0 ) :
		last_digit = temp % 10 ;
		if ( last_digit == 0 or last_digit == 1 ) :
			return False ;
		if ( n % last_digit == 0 ) :
			return False ;
		temp = temp // 10 ;
	return True ;
def solve ( n ) :
	L = power ( 10 , n - 1 ) ;
	R = power ( 10 , n ) - 1 ;
	flag = 0 ;
	for i in range ( L , R + 1 ) :
		answer = check ( i ) ;
		if ( answer ) :
			print ( i )
			flag += 1 ;
			break ;
	if ( flag == 0 ) :
		print ( - 1 )
if __name__ == " _ _ main _ _ " :
	N = 4 ;
	solve ( N ) ;