You are viewing a single comment's thread. Return to all comments →
Short python solution :
def twoArrays(k, A, B): s_A = sorted(A) r_B = sorted(B, reverse=True) for i in range(len(s_A)): # since len(s_A) = len(A) = len(B) if s_A[i] + r_B[i] < k: return "NO" return "YES"
Seems like cookies are disabled on this browser, please enable them to open this website
Permuting Two Arrays
You are viewing a single comment's thread. Return to all comments →
Short python solution :