easy to understand and optimal solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {string} encodedText
 * @param {number} rows
 * @return {string}
 */
var decodeCiphertext = function (encodedText, rows) {
    let res = '';
    let i = 0;
    let j = 0;
    let col = 0;
    let cols = encodedText.length / rows;
    while (i < rows && j < cols) {
        res += encodedText[i*cols + j];
        if (i === rows - 1 || j === cols - 1) {
            i = 0;
            col++;
            j = col;
        } else {
            i++;
            j++;
        }
    }
    return res.trimEnd();
};
```
['JavaScript']