@@ -0,0 +1,665 @@
+public class Solution %7B%0A    public int%5B%5D%5B%5D matrixReshape(int%5B%5D%5B%5D nums, int r, int c) %7B%0A        int originalSize = nums.length * nums%5B0%5D.length;%0A        int size = r*c;%0A        if(size != originalSize)%7B%0A            return nums;%0A        %7D%0A        int%5B%5D%5B%5D res = new int%5Br%5D%5Bc%5D;%0A        int row = 0;%0A        int col = 0;%0A        for(int i=0;i%3Cnums.length;i++)%7B%0A            for(int j = 0 ; j %3C nums%5B0%5D.length ; j++)%7B%0A                if(col == c )%7B%0A                    col = 0;%0A                    res%5B++row%5D%5Bcol++%5D = nums%5Bi%5D%5Bj%5D;%0A                %7Delse%7B%0A                    res%5Brow%5D%5Bcol++%5D = nums%5Bi%5D%5Bj%5D;%0A                %7D%0A            %7D%0A        %7D%0A        return res;%0A    %7D%0A%7D

The solution for 566