human
Minimum boxes required to carry all gifts | Function to return number of boxes.
Sort the boxes in ascending order.
Try to fit smallest box with current heaviest box ( from right side ).
Driver code"
Solution in Python:

=====
Can you provide a code to minimum boxes required to carry all gifts and the other steps required?
assistant
#Here is code to minimum boxes required to carry all gifts and the other steps required.
 def numBoxex ( A , n , K ) :
	A . sort ( )
	i = 0
	j = n - 1
	ans = 0
	while i <= j :
		ans += 1
		if A [ i ] + A [ j ] <= K :
			i += 1
		j -= 1
	return ans
if __name__ == ' _ _ main _ _ ' :
	A = [ 3 , 2 , 2 , 1 ]
	K = 3
	n = len ( A )
	print ( numBoxex ( A , n , K ) )