Simple HashMap
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:\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    fun decodeCiphertext(encodedText: String, rows: Int): String {\n        if (rows==1) return encodedText\n        val map = HashMap<Int, MutableList<Char>>()\n        val rez = mutableListOf<Char>()\n        val cols = encodedText.length / rows\n        for (i in 0 until rows) {\n            for (j in 0 until cols) {\n                if (j - i>=0)\n                map.computeIfAbsent(j - i) \n                { mutableListOf() }.add(encodedText[i*cols+j])\n            }\n        }\n        for((key, value) in map){\n            rez.addAll(value)\n        }\n        // println("map=$map")\n        return rez.joinToString("").trimEnd()\n       \n    }\n}\n```
['Kotlin']