You are viewing a single comment's thread. Return to all comments →
One liner Python: return 'YES' if all(a + b >= k for a, b in zip(sorted(A, reverse=True), sorted(B))) else 'NO'
return 'YES' if all(a + b >= k for a, b in zip(sorted(A, reverse=True), sorted(B))) else 'NO'
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 →
One liner Python:
return 'YES' if all(a + b >= k for a, b in zip(sorted(A, reverse=True), sorted(B))) else 'NO'