human
Minimize sum of given array by removing all occurrences of a single digit | Function to remove each digit from the given integer.
Convert into string.
Stores final string.
Traverse the string.
Append it to the final string.
Return integer value.
Function to find the minimum sum by removing occurences of each digit.
Iterate in range [ 0 , 9 ].
Traverse the array.
Update the minimum sum.
Print the minimized sum.
Driver code"
How can the above be solved in Python?
 Give me a code to minimize sum of given array by removing all occurrences of a single digit and the other steps required?
assistant
#Here is code to minimize sum of given array by removing all occurrences of a single digit and the other steps required.
 def remove ( N , digit ) :
	strN = str ( N )
	ans = ' '
	for i in strN :
		if int ( i ) == digit :
			continue
		ans += i
	return int ( ans )
def getMin ( arr ) :
	minSum = float ( ' inf ' )
	for i in range ( 10 ) :
		curSum = 0
		for num in arr :
			curSum += remove ( num , i )
		minSum = min ( minSum , curSum )
	print ( minSum )
arr = [ 34 , 23 , 85 , 93 ]
getMin ( arr )