human
Check if all K | Function to check all subset - sums of K - length subsets in A [ ] is greater that that in the array B [ ] or not.
Sort the array in ascending order.
Sort the array in descending order.
Stores sum of first K elements of A [ ].
Stores sum of first K elements of B [ ].
Traverse both the arrays.
Update sum1.
Update sum2.
If sum1 exceeds sum2.
Driver Code"
Solution in Python:
assistant
#Here is code to check if all K and the other steps required.
 def checkSubsetSum ( A , B , N , K ) :
	A . sort ( )
	B . sort ( reverse = True )
	sum1 = 0
	sum2 = 0
	for i in range ( K ) :
		sum1 += A [ i ]
		sum2 += B [ i ]
	if ( sum1 > sum2 ) :
		return True
	return False
A = [ 12 , 11 , 10 , 13 ]
B = [ 7 , 10 , 6 , 2 ]
N = len ( A )
K = 3
if ( checkSubsetSum ( A , B , N , K ) ) :
	print ( " Yes " )
else :
	print ( " No " )