Golang solution with explanation
Intuition\nThe length of the suffix (<x/y>) determines everything else. Since the constraints say that that the length of the message is <= 10^4, that means tha
# Intuition\nThe length of the suffix (`<x/y>`) determines everything else. Since the constraints say that that the length of the message is <= 10^4, that means that the mesage can be split into at most 10^4 parts, which means that the length of `y` in our suffix is at most 4.\n\n# Approach\nTry to split the message assuming `y` is length 1 (i.e., less than 10 parts), and increment the length of `y` when that assumption is violated. The first viable solution will be the least number of splits since we used the shortest possible suffix.\n\n# Complexity\n- Time complexity: O(N). We iterate the message at most 4 times.\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(N). We store the splits in a string slice and have a few other variables of constant size.\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nimport "fmt"\nimport "math"\n\nfunc splitMessage(message string, limit int) []string {\n    // This will be the final result. If we don\'t find a workable\n    // solution this will return empty by default.\n    var result []string\n\n    // Start by assuming the denominator (total number of splits) is\n    // one digit long, and work up from there.\n    for denomDigits := 1; denomDigits <= 4; denomDigits++ {\n        // Track how many splits/parts we have so far\n        numParts := 0\n        // Make a copy of the message that we can slice up for\n        // each attempt with a given denominator length\n        m := message\n        // This will contain the message pieces without suffix. We\n        // can\'t know the correct suffix until we\'re done splitting.\n        var splits []string\n\n        // We\'re going to slice off the message bit by bit, so we\n        // know we\'re done when it\'s empty.\n        for len(m) > 0 {\n            numParts++\n            // The number of digits in the current message number\n            // is the base-10 logarithm of the message number,\n            // truncated to an int, plus 1.\n            // Example:\n            // - mesage #4\n            //   math.Log10(4.0) == 0.6020599913279624\n            //   truncate to int => 0\n            //   add 1 => 1\n            numDigits := int(math.Log10(float64(numParts))) + 1\n\n            // If this is true, we aren\'t reserving enough digits\n            // for the total number of splits. Try again with\n            // more digits.\n            if numDigits > denomDigits {\n                splits = nil\n                break\n            }\n\n            // The number of characters we grab is based on the limit.\n            // We have to make room for:\n            //  - The number of digits in the message number\n            //  - The number of digits in the total number of splits\n            //  - The 3 standard suffix characters "</>"\n            toGrab := limit - numDigits - denomDigits - 3\n\n            // We don\'t have room to grab anything, so this won\'t\n            // work. Try again with more digits.\n            if toGrab <= 0 {\n                splits = nil\n                break\n            }\n\n            // Edge case, we are grabbing the last bit of the string\n            // and there\'s not enough left to hit the limit.\n            if toGrab > len(m) {\n                toGrab = len(m)\n            }\n\n            // Add our split to the list and slice off the message.\n            splits = append(splits, m[0:toGrab])\n            m = m[toGrab:]\n        }\n\n        // We found a viable solution.\n        if splits != nil {\n            // d is the total number of splits\n            d := len(splits)\n            for i, s := range splits {\n                // i + 1 because we number 1 to d instead of 0 to\n                // d -1\n                result = append(result, fmt.Sprintf("%s<%d/%d>", s, i + 1, d))\n            }\n            break\n        }\n    }\n    return result\n}\n```
['Go']