Python Build the Cipher Matrix
This solution works as the problem states "the rightmost column will not be empty after filling in originalText". But then just wonder why it not avoid corner c
This solution works as the problem states "the rightmost column will not be empty after filling in `originalText`". But then just wonder why it not avoid corner cases as `len(originalText) == 0`. Anyway, testcase like `"a    ", 4` is treated as invalid case.\n```\ndef decodeCiphertext(s, r):\n\tk = len(s) // r\n\tmat = [s[i*k+i:i*k+k] for i in range(r)]\n\tmat[-1] += " "  # handle trailing characters for rows in mat[:-1]\n\treturn "".join(map("".join, zip(*mat))).rstrip()\n```
['Python']