2075. Decode the Slanted Ciphertext,cpp
Code\n\nclass Solution {\npublic:\n    string decodeCiphertext(string encodedText, int rows) {        \n        if(encodedText.length()==0)\n            return 
**Code**\n```\nclass Solution {\npublic:\n    string decodeCiphertext(string encodedText, int rows) {        \n        if(encodedText.length()==0)\n            return "";\n        string ans="";        \n        int i=0;\n        int j=0;\n        int cols=encodedText.length()/rows;\n        int k=0;\n        while(i<rows && j<cols && k<cols)\n        {\n            ans+=encodedText[i++*cols+k++]; \n            if(i==rows)\n            {\n                j++;\n                k=j;\n                i=0;\n            }\n        }        \n        while(ans[ans.length()-1]==\' \')\n            ans.pop_back();\n        return ans;\n    }\n};\n```
['C']