human
Permute two arrays such that sum of every pair is greater or equal to K | Check whether any permutation exists which satisfy the condition ..
Sort the array a [ ] in decreasing order ..
Sort the array b [ ] in increasing order ..
Checking condition on each index ..
Driver code"
How can the above be solved in Python?
 Give me a code to permute two arrays such that sum of every pair is greater or equal to K and the other steps required?
assistant
#Here is code to permute two arrays such that sum of every pair is greater or equal to K and the other steps required.
 def isPossible ( a , b , n , k ) :
	a . sort ( reverse = True )
	b . sort ( )
	for i in range ( n ) :
		if ( a [ i ] + b [ i ] < k ) :
			return False
	return True
a = [ 2 , 1 , 3 ]
b = [ 7 , 8 , 9 ]
k = 10
n = len ( a )
if ( isPossible ( a , b , n , k ) ) :
	print ( " Yes " )
else :
	print ( " No " )