You are viewing a single comment's thread. Return to all comments →
def twoArrays(k, a, b): a.sort(reverse=True) b.sort() n=len(a) for i in range(n): if not(a[i]+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 →
def twoArrays(k, a, b): a.sort(reverse=True) b.sort() n=len(a) for i in range(n): if not(a[i]+b[i]>=k): return "NO" return "YES"