You are viewing a single comment's thread. Return to all comments →
public static String twoArrays(int k, List<Integer> A, List<Integer> B) { // Write your code here Collections.sort(A); Collections.sort(B,Collections.reverseOrder()); for(int i=0;i<A.size();i++){ if((A.get(i)+B.get(i)>=k)){ continue; }else{ 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 →
Java