Java Solution
Intuition\nIntuition is difficult on this one. Since the question involves getting the least number of parts, binary search should be a reasonable answer; i.e.,
# Intuition\nIntuition is difficult on this one. Since the question involves getting the least number of parts, binary search should be a reasonable answer; i.e., if the current number uses too few parts, go right. If the current number uses too many parts, go left. If the current number uses just the right amount of parts, you have a possible solution.\n\n# Approach\nThe question then becomes, how do you determine when there are too many or too few parts? Well, when the **suffix** grows greater than the **limit**, you need less parts. When you\'re not able to fit the entirety of **message** inside of the given number of parts, you need more parts.\n\n# Complexity\n- Time complexity:\n$$O(n * log n)$$\n\n- Space complexity:\n$$O(n)$$\n\n# Code\n```\nclass Solution {\n    public String[] splitMessage(String message, int limit) {\n        int lo = 1, hi = message.length();\n        int leastNumParts = hi + 1;\n\n        while (lo <= hi) {\n            int mid = lo + (hi - lo) / 2;\n            char testResult = testSplit(message, mid, limit);\n\n            if (testResult == \'L\')\n                hi = mid - 1;\n            else if (testResult == \'R\')\n                lo = mid + 1;\n            else {\n                leastNumParts = mid;\n                hi = mid - 1;\n                lo = 1;\n            }\n        }\n        return leastNumParts > message.length() ? new String[0] : buildSplit(message, leastNumParts, limit);\n    }\n\n    private char testSplit(String message, int numParts, int limit) {\n        int totalLength = 0;\n        int digits = String.valueOf(numParts).length();\n        \n        for (int i = 1; i <= numParts; i++) {\n            int suffixLength = 3 + digits + String.valueOf(i).length();\n            int partLength = Math.min(limit - suffixLength, message.length() - totalLength);\n\n            if (suffixLength >= limit) return \'L\';\n\n            totalLength += partLength;\n        }\n        return totalLength < message.length() ? \'R\' : \'-\';\n    }\n    \n    private String[] buildSplit(String message, int numParts, int limit) {\n        String[] parts = new String[numParts];\n        int messageIndex = 0;\n        int partIndex = 1;\n        int numPartsDigits = String.valueOf(numParts).length();\n\n        while (messageIndex < message.length()) {\n            int partIndexDigits = String.valueOf(partIndex).length();\n            int suffixLength = 3 + partIndexDigits + numPartsDigits;\n            int contentLength = Math.min(limit - suffixLength, message.length() - messageIndex);\n\n            String part = message.substring(messageIndex, messageIndex + contentLength);\n            parts[partIndex - 1] = part + "<" + partIndex + "/" + numParts + ">";\n            partIndex++;\n\n            messageIndex += contentLength;\n        }\n\n        return parts;\n    }\n}\n```
['Binary Search', 'Java']