Two Sub Problems - Find Number of Splits and Split Message
Intuition\n Describe your first thoughts on how to solve this problem. \nTo split the messages, we need to know the total split, we can get out of the message. 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTo split the messages, we need to know the total split, we can get out of the message. This breaks down the problem into 2 simpler problems.\n- Find number of split\n- Split the message\n# Approach\n<!-- Describe your approach to solving the problem. -->\n## Find Number of Message Split\nDepending on the length of the messages, and the limit, our last suffix could be in the range:\n- <1/1>, ..., <9/9>\n- <10/10>, ..., <99,99>\n- <100/100>, ..., <999/999>\n- ...\n\nLets assume that our last suffix is going t0 be <9/9>.\nThen we calculate number of possible characters all message splits from <1/1> to <9/9> can take as follows:\n```\nnum_chars = limit - 5 // 5 is the length of the suffix <9/9>\nused_chars = 9 * num_chars\ntotal_splits += 9\n```\nif we exhausted all the characters in the message, we know this is our band but we need to determine the actual number of splits.\nFirst we assume our total split is 9. Then we remove any overflow splits from it.\n```\ntotal_splits -= (used_chars - msg_len) / num_chars // 9 is the number of possible splits in this band.\n```\n\nIf we did not exhaust all the message characters, we move to the next suffix band <99/99>.\nfirst we need to determine the remaining message length by subtracting the number of characters we used in the previous band. Notice also that if we used this band to calculate number of characters in the previous band, we could have used 9 characters less than our previous calculation. so we update our remaining message length as follows:\n```\nmsg_len += (prev_used_chars - total_splits)\n```\n\nNext we need to calculate number characters we can use in this band and use it to determine the total used characters in the band.\n```\nnum_chars = limit - 7\nused_chars = 90 * num_chars // 90 because we have already used 9 out of the 99 possible splits in this band.\ntotal_splits += 90\n```\n\nAgain, if we exhausted all the characters in the message, we know this is our band but we need to determine the actual number of splits.\nFirst we assume our total split is 90. Then we remove any overflow splits from it.\ntotal_splits -= (used_chars - msg_len) / num_chars\n\nWe need to repeat this process for every band until we have exhausted all the message characters\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```python3 []\nclass Solution:\n    def get_total_splits(self, msg_len: int, limit: int) -> int:\n        total_splits: int = 0\n        suffix_len: int = 5\n        curr_split: int = 9\n\n        while msg_len > 0:\n            num_chars: int = limit - suffix_len\n            if num_chars <= 0:\n                return 0\n\n            msg_len += total_splits\n            total_splits += curr_split\n            used_chars: int = num_chars * curr_split\n            if used_chars >= msg_len:\n                total_splits -= (used_chars - msg_len) // num_chars\n\n            msg_len -= used_chars\n            curr_split *= 10\n            suffix_len += 2\n        return total_splits\n\n\n    def splitMessage(self, message: str, limit: int) -> List[str]:\n        total_splits: int = self.get_total_splits(len(message), limit)\n        if total_splits == 0:\n            return []\n\n        msg_splits: List[str] = []\n        total_splits_len: int = len(str(total_splits))\n        start_index: int = 0\n        for split_index in range(1, total_splits + 1):\n            num_chars: int = limit - 3 - len(str(split_index)) - total_splits_len\n            curr_msg = message[start_index:start_index+num_chars]\n            msg_splits.append(f"{curr_msg}<{split_index}/{total_splits}>")\n            start_index += num_chars\n\n        return msg_splits\n```
['Python3']