easy solution
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 encodedText, int rows) {\n        StringBuilder res = new StringBuilder();\n        if(rows == 0) return res.toString();\n        if(rows == 1) return encodedText;\n\n        int cols = encodedText.length() / rows;\n        char[][] matrix = new char[rows][cols];\n\n       \n        int  k =0;\n        for(int i = 0; i < rows ; i++){\n                for(int j = 0; j < cols ; j++){\n                \n                       \n                    matrix[i][j] = encodedText.charAt(k++);\n                }\n                    \n        }\n            \n        //for(int  i = 0; i < rows ; i++)System.out.println(Arrays.toString(matrix[i])+" ");\n        for(int col = 0 ; col < cols ; col++){\n            int rowIndex = 0, colIndex = col;\n            while(rowIndex < rows && colIndex < cols ){\n                res.append (matrix[rowIndex++][colIndex++]);\n            }\n        }\n        \n        return res.toString().replaceAll("[ ]+$", "");\n    }\n}\n```
['Java']