@@ -0,0 +1,1894 @@
+import java.io.*;%0Aimport java.math.*;%0Aimport java.security.*;%0Aimport java.text.*;%0Aimport java.util.*;%0Aimport java.util.concurrent.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    // Complete the gridChallenge function below.%0A    static String gridChallenge(String%5B%5D grid) %7B%0A        for(int i=0;i%3Cgrid.length;i++)%7B%0A            char%5B%5D k = grid%5Bi%5D.toCharArray();%0A            Arrays.sort(k);%0A            String s = new String(k);%0A            grid%5Bi%5D=s;%0A            //System.out.println(s);%0A        %7D%0A        int sum = 0;%0A        for(int i=0;i%3Cgrid.length;i++)%7B%0A            //char first = grid%5Bi%5D.charAt(0);%0A            for(int j=1;j%3Cgrid.length;j++)%7B%0A                //System.out.println(grid%5Bj%5D.charAt(i));%0A                if(grid%5Bj%5D.charAt(i)%3Cgrid%5Bj-1%5D.charAt(i)) return %22NO%22;%0A                //System.out.println(grid%5Bj%5D.charAt(i));%0A                //System.out.print(grid%5Bj%5D.charAt(i));%0A                //System.out.println(%22 %22+ grid%5Bj-1%5D.charAt(i));%0A            %7D%0A        %7D%0A        return %22YES%22;%0A    %7D%0A%0A    private static final Scanner scanner = new Scanner(System.in);%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv(%22OUTPUT_PATH%22)));%0A%0A        int t = scanner.nextInt();%0A        scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A        for (int tItr = 0; tItr %3C t; tItr++) %7B%0A            int n = scanner.nextInt();%0A            scanner.skip(%22(%5Cr%5Cn%7C%5B%5Cn%5Cr%5Cu2028%5Cu2029%5Cu0085%5D)?%22);%0A%0A            String%5B%5D grid = new String%5Bn%5D;%0A%0A            for (int i = 0; i %3C n; i++) %7B%0A                String gridItem = scanner.nextLine();%0A                grid%5Bi%5D = gridItem;%0A            %7D%0A%0A            String result = gridChallenge(grid);%0A%0A            bufferedWriter.write(result);%0A            bufferedWriter.newLine();%0A        %7D%0A%0A        bufferedWriter.close();%0A%0A        scanner.close();%0A    %7D%0A%7D%0A

add GridChallenge.java