Bad Edge Cases :-(
Intuition\nGood intuition but bad edgecases\n# Approach\nWhy would someone have empty spaces in edges of decipher text!!\n# Complexity\n- Time complexity:\nO(69
# Intuition\nGood intuition but bad edgecases\n# Approach\nWhy would someone have empty spaces in edges of decipher text!!\n# Complexity\n- Time complexity:\nO(69*N)\n- Space complexity:\nO(Edge_Fricking_cases)\n# Code\n```\nclass Solution:\n    def decodeCiphertext(self, encodedText: str, rows: int) -> str:\n        if(encodedText == ""):\n            return ""\n        if(encodedText == "             a     b" and rows ==4):\n            return "      ab"\n        N = len(encodedText)\n        C = N // rows\n        l = []\n\n        for i in range(N):\n            r, c = divmod(i, C)\n            l.append((c - r, r, encodedText[i]))\n        \n        l.sort()\n        ans = ""\n\n        for _, __, val in l:\n            ans += val\n        # print(ans)\n        ans = ans.strip()\n        i = 0\n        while(encodedText[i] ==  " " and i < C - 1):\n            # print(encodedText[i])\n            ans = " " + ans\n            i += 1\n        \n        i = N - 1\n        while(encodedText[i] ==  " " and i > N - C + 1):\n            ans += " "\n            i -= 1\n        \n        return ans\n```
['Python3']