package hackerrank;

/**
 * https://www.hackerrank.com/challenges/two-arrays
 */
public class TwoArrays {
    public static void main(String[] args) {

    }
}

@@ -14,16 +14,68 @@
 rrank;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Scanner;%0A%0A
 /**%0A * h
@@ -160,48 +160,890 @@
    p
-ublic static void main(String%5B%5D args) %7B%0A
+rivate static String twoArrays(Integer%5B%5D a, Integer%5B%5D b, int k) %7B%0A        Arrays.sort(a);%0A        Arrays.sort(b, (x, y) -%3E Integer.compare(y, x));%0A        for (int i = 0; i %3C a.length; i++) %7B%0A            if (a%5Bi%5D + b%5Bi%5D %3C k) %7B%0A                return %22NO%22;%0A            %7D%0A        %7D%0A        return %22YES%22;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int testCases = in.nextInt();%0A        for (int t = 0; t %3C testCases; t++) %7B%0A            int n = in.nextInt();%0A            int k = in.nextInt();%0A            Integer%5B%5D a = new Integer%5Bn%5D;%0A            for (int i = 0; i %3C n; i++) %7B%0A                a%5Bi%5D = in.nextInt();%0A            %7D%0A            Integer%5B%5D b = new Integer%5Bn%5D;%0A            for (int i = 0; i %3C n; i++) %7B%0A                b%5Bi%5D = in.nextInt();%0A            %7D%0A            System.out.println(twoArrays(a, b, k));%0A        %7D
 %0A   

Solve Two Arrays