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