human
What is a code to fascinating Number and the other steps required given the following:
Fascinating Number | function to check if number is fascinating or not.
frequency count array using 1 indexing.
obtaining the resultant number using string concatenation.
Traversing the string character by character.
gives integer value of a character digit.
To check if any digit has appeared multiple times.
Traversing through freq array to check if any digit was missing.
Driver Code.
Input number.
Not a valid number.
Calling the function to check if input number is fascinating or not"
Solution in Python:
assistant
#Here is code to fascinating Number and the other steps required.
 def isFascinating ( num ) :
	freq = [ 0 ] * 10
	val = ( str ( num ) + str ( num * 2 ) + str ( num * 3 ) )
	for i in range ( len ( val ) ) :
		digit = int ( val [ i ] )
		if freq [ digit ] and digit != 0 > 0 :
			return False
		else :
			freq [ digit ] += 1
	for i in range ( 1 , 10 ) :
		if freq [ i ] == 0 :
			return False
	return True
if __name__ == " _ _ main _ _ " :
	num = 192
	if num < 100 :
		print ( " No " )
	else :
		ans = isFascinating ( num )
		if ans :
			print ( " Yes " )
		else :
			print ( " No " )