human
Maximum triplet sum in array | This function assumes that there are at least three elements in arr [ ] ..
sort the given array.
After sorting the array . Add last three element of the given array.
Driven code"
Solution in Python:
assistant
#Here is code to maximum triplet sum in array and the other steps required.
 def maxTripletSum ( arr , n ) :
	arr . sort ( )
	return ( arr [ n - 1 ] + arr [ n - 2 ] + arr [ n - 3 ] )
arr = [ 1 , 0 , 8 , 6 , 4 , 2 ]
n = len ( arr )
print ( maxTripletSum ( arr , n ) )