An recursive implementation
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(log_10 N * N/limit)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n# Code\n```\nclass Solution:\n    # O(log_10 N * N/limit)\n    def splitMessage(self, message: str, limit: int) -> List[str]:\n        N = len(message)\n\n        # O(N / (limit-tagLen)), roughtly O(N/limit)\n        def dfs(bLen, start, count):\n            tag = f\'<{count}/>\'\n            tagLen = len(tag) + bLen\n            if len(str(count)) > bLen or start >= N:\n                return -1\n\n            if N-start+tagLen <= limit:\n                return count\n\n            res = dfs(bLen, start+limit-tagLen, count+1)\n            return res\n\n        count = -1\n        # O(log_10 N)\n        for i in range(len(str(N))):\n            count = dfs(i+1, 0, 1)\n            if count > -1:\n                break\n        \n        res = []\n        if count == -1:\n            return res\n\n        start = 0\n        # O(N/limit)\n        for i in range(count):\n            tag = f\'<{i+1}/{count}>\'\n            txtLen = limit-len(tag) \n            end = start + txtLen\n            txt = f\'{message[start : end]}{tag}\'\n            res.append(txt)\n            start = end\n\n        return res\n```
['Python3']