Easy approach using JAVA
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public String decodeCiphertext(String str, int row) {\n        if(row == 1) return str;\n        int n = str.length();\n        int col = n/row;\n        char mat[][] = new char[row][col];\n        int k = 0;\n        for(int i = 0 ; i<row ; i++){\n            for(int j = 0 ; j<col ; j++){\n                mat[i][j] = str.charAt(k++);\n            }\n        }\n        StringBuilder sb = new StringBuilder();\n        for(int i = 0 ; i<col ; i++){\n            sb.append(decode(0 , i , mat , row , col));\n        }\n        int len = sb.length()-1;\n        while(len > 0 && sb.charAt(len) == \' \'){\n          len--;\n        }\n        return sb.toString().substring(0 , len+1);\n    }\n    public String decode(int i , int j , char[][] mat , int n , int m){\n        StringBuilder sb = new StringBuilder();\n        for(int k = i , p = j ; k<n && p < m ; k++ , p++){\n            sb.append(mat[k][p]);\n        }\n        return sb.toString();\n    }\n}\n```
['Java']