You are viewing a single comment's thread. Return to all comments →
string twoArrays(int k, vector<int> A, vector<int> B) { int c=0; for(int i=0;i<A.size();i++){ if(A[i]/k>0){ A[i] = k; } if(B[i]/k>0){ B[i] = k; } int d = A[i]+B[i]+c; c = d - k; } if(c<0)return "NO"; else 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 →