[Python3] 260ms runtime, Faster than 96% and uses 91% less memory
Execution Result\n\n\nRuntime: 260 ms, faster than 96.14% of Python3 online submissions for Decode the Slanted Ciphertext.\nMemory Usage: 26.8 MB, less than 91.
`Execution Result`\n\n```\nRuntime: 260 ms, faster than 96.14% of Python3 online submissions for Decode the Slanted Ciphertext.\nMemory Usage: 26.8 MB, less than 91.49% of Python3 online submissions for Decode the Slanted Ciphertext.\n```\n\n`Code`\n```\nclass Solution:\n    def decodeCiphertext(self, encodedText: str, rows: int) -> str:\n        op = \'\'\n        total_cols = int(   len(encodedText) / rows )\n        row = 0\n        col = 0\n        while True:\n            try:\n                calc = (row*total_cols)+row+col\n                char = encodedText[calc]\n            except IndexError:\n                break\n            op += char\n            row+=1\n            if row == rows:\n                row = 0\n                col+=1\n        return op.rstrip()\n```\n\n`Tests`\n```\nprint(Solution().decodeCiphertext(encodedText = "ch   ie   pr", rows = 3))\nprint(Solution().decodeCiphertext(encodedText = "iveo    eed   l te   olc", rows = 4))\nprint(Solution().decodeCiphertext(encodedText = "coding", rows = 1))\nprint(Solution().decodeCiphertext(encodedText = " b  ac", rows = 2))\nprint(Solution().decodeCiphertext("wmihfwf bddhzaizuzhbuoovyyjstardqceaqzafdzihjbj ywly amkeemr jmvsfaavbpgiafgxzciwmrrtasthc hqfrtwoizoilw", 2)  )\nN = pow(10, 6)\nimport random, string\nprint(Solution().decodeCiphertext(encodedText = \'\'.join(random.choices(string.ascii_lowercase + \' \', k=N)), rows = pow(10, 3)))\n```
['Python3']