C++ easy and concise solution
Please, upvote if you like it. Thanks :-)Complexity

Time complexity:
O(n)


Space complexity:
O(1)

Code
Please, upvote if you like it. Thanks :-)

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```cpp []
string decodeCiphertext(string encText, int rows) {
    string res = "";
    int cols = encText.size() / rows, sz = rows * cols;
    for (int j = 0; j < cols; j++)
        for (int i = 0; i < rows; i++) {
            int ind = i * cols + j + i;
            if (ind < sz && encText[ind] != '\0')
                res += encText[ind];
        }
    while (!res.empty() && res.back() == ' ')
        res.pop_back();
    return res;
}
```
['String', 'Matrix', 'Simulation', 'C++']