C++ O(n) simple solution
Let the total number of part is total_num.\nLet\'s see. Every part is in the form of "_". The "<", ">", "/" are constant. The value of index does not depend on 
Let the total number of part is total_num.\nLet\'s see. Every part is in the form of "_<index/total_num>". The "<", ">", "/" are constant. The value of index does not depend on our choice so we can treat it as constant. So the only remaining variables are **no of digit** in total_num and no of characters. Since there is a limit, the no of character depend on the **no of digit** in total_num. \nSince the size of message can be atmost 10<sup>4</sup>. No of digit will be atmost 4.\n```\nint digit(int num){\n\tif(num == 0)return 1;\n\tint ans = 0;\n\twhile(num > 0){\n\t\tans++;\n\t\tnum /= 10;\n\t}\n\treturn ans;\n}\nvector<string> splitMessage(string message, int limit) {\n\tif(limit <= 4)return {};\n\tint ans = 1e9;\n\tfor(int dig = 1;dig <= 5;dig++){\n\t\tint index = 1, max_no_of_char = limit-(digit(index)+dig+3), no_of_char = 0, flag = 1;\n\t\tfor(char &i:message){\n\t\t\tno_of_char++;\n\t\t\tif(no_of_char > max_no_of_char){\n\t\t\t\tindex++;\n\t\t\t\tmax_no_of_char = limit-(digit(index)+dig+3);\n\t\t\t\tno_of_char = 1;\n\t\t\t\tif(max_no_of_char <= 0){ // No space left to put a character\n\t\t\t\t\tflag = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(digit(index) > dig){ // The no of digit of last index is more than the allowed value.\n\t\t\tflag = 0;\n\t\t}\n\t\tif(flag == 1){\n\t\t\tans = index;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif(ans == 1e9)return {};\n\tvector<string>v;\n\tstring str;\n\tint index = 1;\n\tint max_no_of_char = limit-(digit(ans)+digit(index)+3), no_of_char = 0;\n\tfor(char &i:message){\n\t\tstr += i;\n\t\tno_of_char++;\n\t\tif(no_of_char == max_no_of_char){\n\t\t\tstr += \'<\';\n\t\t\tstr += to_string(index);\n\t\t\tstr += \'/\';\n\t\t\tstr += to_string(ans);\n\t\t\tstr += \'>\';\n\t\t\tv.push_back(str);\n\t\t\tstr = "";\n\t\t\tindex++;\n\t\t\tno_of_char = 0;\n\t\t\tmax_no_of_char = limit-(digit(ans)+digit(index)+3);\n\t\t}\n\t}\n\tif(no_of_char > 0){\n\t\tstr += \'<\';\n\t\tstr += to_string(index);\n\t\tstr += \'/\';\n\t\tstr += to_string(ans);\n\t\tstr += \'>\';\n\t\tv.push_back(str);\n\t}\n\treturn v;\n}\n```
['C']