C++ solution
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(n)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(n)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string decodeCiphertext(string et, int rows) {\n        int cols = et.size()/rows;\n        string ans;\n        for(int k=0; k<cols; k++){\n            for(int i=0, j=k; i<rows and j<cols; i++, j++){\n                ans+=et[i*cols + j];\n            }\n        }\n        while(ans.size() and ans.back()==\' \') ans.pop_back();\n        return ans;\n    }\n};\n```
['C++']