Java - Iterate Diagonally!!!
```\nclass Solution {\n    public String decodeCiphertext(String str, int rows) {\n\n        //first find column size!!\n    \tint cols=str.length()/rows;\n    
```\nclass Solution {\n    public String decodeCiphertext(String str, int rows) {\n\n        //first find column size!!\n    \tint cols=str.length()/rows;\n    \tStringBuilder res=new StringBuilder(),new_res=new StringBuilder();;\n    \tfor(int i=0;i<cols;i++) {\n        \n            //iterating diagonally!!\n            for(int j=i;j<str.length();j+=cols+1)\n    \t\t\tres.append(str.charAt(j));\n    \t}\n        \n        //removing last spaces!!!\n        int fg=0;\n        for(int i=res.length()-1;i>=0;i--) {\n            \n            if(fg==0&&res.charAt(i)==\' \')\n                continue;\n            fg=1;\n            new_res.append(res.charAt(i));\n        }\n        return new_res.reverse().toString();\n    }\n}\n````
['Java']