@@ -0,0 +1,1248 @@
+public class Solution %7B%0A    public int%5B%5D%5B%5D matrixReshape(int%5B%5D%5B%5D nums, int r, int c)%7B%0A        if(nums.length*nums%5B0%5D.length != c*r) return nums;%0A        int%5B%5D%5B%5D result = new int%5Br%5D%5Bc%5D;%0A        int%5B%5D oneDimensionalArray = new int%5Br*c%5D;%0A        int index = 0;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            for (int j = 0; j %3C nums%5Bi%5D.length; j++) %7B%0A                oneDimensionalArray%5Bindex++%5D = nums%5Bi%5D%5Bj%5D;%0A            %7D%0A        %7D%0A        int row = 0;%0A        int column = 0;%0A        for (int i = 0; i %3C oneDimensionalArray.length; i++) %7B%0A            if((i+1)%25c == 0)%7B%0A                result%5Brow%5D%5Bcolumn++%5D = oneDimensionalArray%5Bi%5D;%0A                row++;%0A                column = 0;%0A            %7Delse%7B%0A                result%5Brow%5D%5Bcolumn++%5D = oneDimensionalArray%5Bi%5D;%0A            %7D%0A        %7D%0A        return result;%0A    %7D%0A%0A    public static void main(String%5B%5D args)%7B%0A        Solution solution = new Solution();%0A        int%5B%5D%5B%5D nums = %7B%7B1,2%7D, %7B3, 4%7D%7D;%0A        int%5B%5D%5B%5D result = solution.matrixReshape(nums, 4, 1);%0A        for (int i = 0; i %3C result.length; i++) %7B%0A            for (int j = 0; j %3C result%5Bi%5D.length; j++) %7B%0A                System.out.print(result%5Bi%5D%5Bj%5D+%22 %22);%0A            %7D%0A            System.out.println();%0A        %7D%0A    %7D%0A%7D%0A

complete problem 566