You are viewing a single comment's thread. Return to all comments →
My C++ Solution
string twoArrays(int k, vector<int> A, vector<int> B) { sort(A.begin(),A.end()); sort(B.begin(),B.end(), greater<int>()); for(int i=0;i<A.size();i++){ if(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 →
My C++ Solution