human
Find smallest possible Number from a given large Number with same count of digits | Function for finding the smallest possible number after swapping the digits any number of times.
Variable to store the final answer.
Array to store the count of occurrence of each digit.
Loop to calculate the number of occurrences of every digit.
Loop to get smallest number.
Returning the answer.
Driver code"
How can the above be solved in Python?
assistant
#Here is code to find smallest possible Number from a given large Number with same count of digits and the other steps required.
 def smallestPoss ( s , n ) :
	ans = " " ;
	arr = [ 0 ] * 10 ;
	for i in range ( n ) :
		arr [ ord ( s [ i ] ) - 48 ] += 1 ;
	for i in range ( 10 ) :
		for j in range ( arr [ i ] ) :
			ans = ans + str ( i ) ;
	return ans ;
if __name__ == ' _ _ main _ _ ' :
	N = 15 ;
	K = "325343273113434" ;
	print ( smallestPoss ( K , N ) ) ;