Simple Approach || C++ || Check For every Number of Spilit
\nclass Solution {\npublic:\n    string getSuffix(int a,int b){\n        string suffix = "<" + to_string(a) + "/" + to_string(b) + ">";\n        return suffix; 
```\nclass Solution {\npublic:\n    string getSuffix(int a,int b){\n        string suffix = "<" + to_string(a) + "/" + to_string(b) + ">";\n        return suffix; \n    }\n    vector<string> splitMessage(string s, int limit) {\n        if(limit < 6)\n            return {};\n        int sum = 0;\n        int i;\n        for(i = 1;true;i++){\n            string a = to_string(i);\n\t\t\tsum += 3 + a.size();         //space required to  adjust "<a/>" after ith spilit\n\t\t\t/*\n\t\t\t\tlimit*i = total space we get after ith spilit\n\t\t\t\tsum = space required to  adjust "<a/>" after ith spilit\n\t\t\t\ta.size()*i = space required to adjust "b" after the ith spilit\n\t\t\t\tthen (limit*i  - sum - a.size()*i ) represent the space used for adjusting the string\n\t\t\t\tand when it is greater than size of string we got the total numner of spilit required\n\t\t\t*/\n            if(limit*i  - sum - a.size()*i >= s.size())           \n                break;\n\t\t\t\t\n\t\t\t// if the total space is used for adjusting the suffix part only then we can\'t spilit and return\n            if(limit <= 3 + a.size() + a.size())\n                return {};\n        }\n        int k = 0;\n        vector<string> res(i,"");\n        for(int j = 1;j <= i;j++){\n            string suffix = getSuffix(j,i);\n            for(int l = 0;l < limit - suffix.size() && l +k < s.size();l++)\n                res[j-1] += s[l+k];\n            \n            \n            res[j-1] += suffix;\n            k += limit - suffix.size();\n        }\n        return res;\n    }\n};\n```\n\n
[]