You are viewing a single comment's thread. Return to all comments →
in JS:
function twoArrays(k, A, B) { const n = A.length; const sortedA = A.sort((a,b) => a - b); const sortedB = B.sort((a,b) => b - a); for (let i = 0; i < n; i++) { if (!(sortedA[i] + sortedB[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 →
in JS: