human
Find maximum number that can be formed using digits of a given number | Function to print maximum number.
Hashed array to store count of digits.
Converting given number to string.
Updating the count array.
Result stores final number.
traversing the count array to calculate the maximum number.
return the result.
Driver code"
How can the above be solved in Python?
 ... Write me a code to find maximum number that can be formed using digits of a given number and the other steps required?
assistant
#Here is code to find maximum number that can be formed using digits of a given number and the other steps required.
 def printMaximum ( inum ) :
	count = [ 0 for x in range ( 10 ) ]
	string = str ( num )
	for i in range ( len ( string ) ) :
		count [ int ( string [ i ] ) ] = count [ int ( string [ i ] ) ] + 1
	result = 0
	multiplier = 1
	for i in range ( 10 ) :
		while count [ i ] > 0 :
			result = result + ( i * multiplier )
			count [ i ] = count [ i ] - 1
			multiplier = multiplier * 10
	return result
num = 38293367
print printMaximum ( num )