import java.util.regex.Pattern;

public class Matrix {
    private int[][] matrix;
    private static Pattern spacePattern = Pattern.compile(" ");
    private static Pattern newlinePattern = Pattern.compile("\\n");

    public Matrix(String matrixAsString) {
        String[] rows = newlinePattern.split(matrixAsString);
        matrix = new int[rows.length][];
        for (int i = 0; i < rows.length; i++) {
            String[] columnValues = spacePattern.split(rows[i]);
            matrix[i] = new int[columnValues.length];
            for (int j = 0; j < columnValues.length; j++) {
                matrix[i][j] = Integer.parseInt(columnValues[j]);
            }
        }
    }

    public int[] getRow(int rowNumber) {
        return matrix[rowNumber];
    }

    public int[] getColumn(int columnNumber) {
        int[] column = new int[matrix.length];
        for(int i = 0; i < matrix.length; i++) {
            column[i] = matrix[i][columnNumber];
        }
        return column;
    }

    public int getRowsCount() {
        return matrix.length;
    }

    public int getColumnsCount() {
        return matrix[0].length;
    }
}

@@ -26,23 +26,16 @@
 ttern;%0A%0A
-public 
 class Ma
@@ -206,22 +206,16 @@
 );%0A%0A    
-public
  Matrix(
@@ -662,39 +662,32 @@
    %7D%0A    %7D%0A%0A    
-public 
 int%5B%5D getRow(int
@@ -745,23 +745,16 @@
  %7D%0A%0A    
-public 
 int%5B%5D ge
@@ -966,31 +966,24 @@
 %0A    %7D%0A%0A    
-public 
 int getRowsC
@@ -1036,15 +1036,8 @@
     
-public 
 int 

make classes and methods package private in reference solution. Resolved the issue (#1083)