human
Find the number of strings formed using distinct characters of a given string | Function to return the factorial of n.
Function to return the count of all possible strings that can be formed with the characters of the given string without repeating characters.
To store the distinct characters of the string str.
Driver code"
Solution in Python:
assistant
#Here is code to find the number of strings formed using distinct characters of a given string and the other steps required.
 def fact ( n ) :
	fact = 1 ;
	for i in range ( 1 , n + 1 ) :
		fact *= i ;
	return fact ;
def countStrings ( string , n ) :
	distinct_char = set ( ) ;
	for i in range ( n ) :
		distinct_char . add ( string [ i ] ) ;
	return fact ( len ( distinct_char ) ) ;
if __name__ == " _ _ main _ _ " :
	string = " geeksforgeeks " ;
	n = len ( string ) ;
	print ( countStrings ( string , n ) ) ;