Beats 70%
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```cpp []\nclass Solution {\npublic:\n    string decodeCiphertext(string encodedText, int rows) {\n        int n=encodedText.size();\n        if(n==0) return "";\n        int cols=n/rows;\n        string result="";\n        for(int col=0;col<cols;++col){\n            for(int row=0;row<rows;++row){\n                int val=row*cols+row+col;\n                if(val<n){\n                    result+=encodedText[val];\n                }\n            }\n        }\n        while(!result.empty() &&result.back()==\' \'){\n            result.pop_back();\n        }\n        return result;\n    }\n};\n```
['C++']