human
Find the largest number that can be formed with the given digits | Function to generate largest possible number with given digits.
Declare a hash array of size 10 and initialize all the elements to zero.
store the number of occurrences of the digits in the given array into the hash table.
Traverse the hash in descending order to print the required number.
Print the number of times a digits occurs.
Driver code"
Solution in Python:
 Give me a code to find the largest number that can be formed with the given digits and the other steps required?
assistant
#Here is code to find the largest number that can be formed with the given digits and the other steps required.
 def findMaxNum ( arr , n ) :
	hash = [ 0 ] * 10
	for i in range ( n ) :
		hash [ arr [ i ] ] += 1
	for i in range ( 9 , - 1 , - 1 ) :
		for j in range ( hash [ i ] ) :
			print ( i , end = " " )
if __name__ == " _ _ main _ _ " :
	arr = [ 1 , 2 , 3 , 4 , 5 , 0 ]
	n = len ( arr )
	findMaxNum ( arr , n )