human
Pandigital number in a given base | Return true if n is pandigit else return false ..
Checking length is less than base.
Traversing each digit of the number ..
If digit is integer.
If digit is alphabet.
Checking hash array , if any index is unmarked ..
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to pandigital number in a given base and the other steps required.
 def checkPandigital ( b , n ) :
	if ( len ( n ) < b ) :
		return 0 ;
	hash = [ 0 ] * b ;
	for i in range ( len ( n ) ) :
		if ( n [ i ] >= '0' and n [ i ] <= '9' ) :
			hash [ ord ( n [ i ] ) - ord ( '0' ) ] = 1 ;
		elif ( ord ( n [ i ] ) - ord ( ' A ' ) <= b - 11 ) :
			hash [ ord ( n [ i ] ) - ord ( ' A ' ) + 10 ] = 1 ;
	for i in range ( b ) :
		if ( hash [ i ] == 0 ) :
			return 0 ;
	return 1 ;
b = 13 ;
n = "1298450376ABC " ;
if ( checkPandigital ( b , n ) ) :
	print ( " Yes " ) ;
else :
	print ( " No " ) ;