human
Can you provide a code to given count of digits 1 , 2 , 3 , 4 , find the maximum sum possible and the other steps required given the following:
Given count of digits 1 , 2 , 3 , 4 , find the maximum sum possible | Function to find the maximum possible sum.
To store required sum.
Number of 234 's can be formed.
Sum obtained with 234 s.
Remaining 2 's.
Sum obtained with 12 s.
Return the required sum.
Driver Code"
Solution in Python:
assistant
#Here is code to given count of digits 1 , 2 , 3 , 4 , find the maximum sum possible and the other steps required.
 def Maxsum ( c1 , c2 , c3 , c4 ) :
	sum = 0
	two34 = min ( c2 , min ( c3 , c4 ) )
	sum = two34 * 234
	c2 -= two34
	sum += min ( c2 , c1 ) * 12
	return sum
c1 = 5 ; c2 = 2 ; c3 = 3 ; c4 = 4
print ( Maxsum ( c1 , c2 , c3 , c4 ) )