2 steps solution - easy understanding
Intuition\n  2 steps to split message\n\n# Approach\n  Step 1: calculate an array whose item is the chars     amount that can be spliited at a specific suffix l
# Intuition\n  2 steps to split message\n\n# Approach\n  Step 1: calculate an array whose item is the chars     amount that can be spliited at a specific suffix length.\n     Step 2: calcuate the total number of splitted message. Based on the array from step 1, copy meessage into final answer array.\n \n\n# Complexity\n- Time complexity:\n  O(N)\n\n- Space complexity:\n  O(N)\n\n# Code\n```\n/**\n * @param {string} message\n * @param {number} limit\n * @return {string[]}\n */\nvar splitMessage = function (message, limit) {\n  if (limit <= 5) return [];\n\n  const MESSAGE_LEN = message.length;\n  const NINE = 9;\n\n  /* \n  // the suffix is in format <index/total>, both index and total are number type\n\n  When given digits value, calcuate an array.\n  Item of the array is the total chars can be spliited from message, at this level the suffix is same length.\n  But the next item of the array, the suffix length will be ONE more than previous. \n\n  digits: digit length of the [total number] of splitted message\n   value 1: means range of [1, 9] messages allowed to be splitted.\n   value 2: means range of [1, 99] messages allowed to be splitted.\n   value 3: means range of [1, 999] messages allowed to be splitted.\n   ...etc\n   */\n  function calcuate(digits) {\n    let sum = 0;\n    let charsAmountArr = [];\n\n    // the suffix is in format <index/total>, both index and total are number type\n    for (let idxLen = 1; idxLen <= digits; idxLen++) {\n      let countCanSplit = NINE * Math.pow(10, idxLen - 1);\n      let charsCanSplit = countCanSplit * (limit - 3 - digits - idxLen);\n      charsAmountArr.push(charsCanSplit);\n      sum += charsCanSplit;\n    }\n\n    if (sum < MESSAGE_LEN) return [];\n    else return charsAmountArr;\n  }\n\n  let charsAmountArr = [];\n  for (let i = 1; i <= limit - 5; i++) {\n    charsAmountArr = calcuate(i);\n    if (charsAmountArr.length > 0) break;\n  }\n  if (charsAmountArr.length < 1) return [];\n\n  // the suffix is in format <index/total>, both index and total are number\n  // Now, we need calcuate the total value\n  let remaining = MESSAGE_LEN;\n  let arrLen = charsAmountArr.length;\n  for (let i = 0; i < arrLen - 1; i++) remaining -= charsAmountArr[i];\n  let base = Math.pow(10, arrLen - 1) - 1;\n  let chars = limit - 3 - 2 * arrLen;\n  let total = base + Math.ceil(remaining / chars);\n\n  let ans = [];\n  let copyStartIndex = 0;\n  let splitIndex = 1;\n  for (let i = 0; i < arrLen; i++) {\n    let charsAmount = charsAmountArr[i];\n    let chars = limit - 3 - arrLen - (i + 1);\n    for (let j = 0; j < charsAmount / chars; j++) {\n      let copyEndIdx = Math.min(copyStartIndex + chars, MESSAGE_LEN);\n      ans.push(\n        `${message.substring(\n          copyStartIndex,\n          copyEndIdx\n        )}<${splitIndex}/${total}>`\n      );\n      if (copyEndIdx === MESSAGE_LEN) return ans;\n\n      splitIndex++;\n      copyStartIndex = copyEndIdx;\n    }\n  }\n\n  return ans;\n};\n```
['JavaScript']