@@ -0,0 +1,855 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Java1DArrayPart2 %7B%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 i=0;i%3CtestCases;i++) %7B%0A            int n=in.nextInt(),m=in.nextInt(),arr%5B%5D=new int%5Bn%5D;%0A            for (int j=0;j%3Cn;j++) %7B%0A                arr%5Bj%5D=in.nextInt();%0A            %7D%0A            if(isWinnable (0, arr, m)) System.out.println(%22YES%22);%0A            else System.out.println(%22NO%22);%0A        %7D%0A    %7D%0A    public static boolean isWinnable (int i, int%5B%5D arr, int m) %7B%0A        if (i%3C0%7C%7Carr%5Bi%5D==1)return false;%0A        if (i==arr.length-1 %7C%7C i+m%3Earr.length-1) return true;%0A%09arr%5Bi%5D=1;%0A%09return isWinnable (i+1, arr, m) %7C%7C isWinnable (i-1, arr, m) %7C%7C isWinnable (i+m, arr, m);%0A    %7D%0A%7D%0A

Create Java1DArrayPart2.java