C++| Simple Linear Search + Maths | O(N)
\nclass Solution {\npublic:\n    int find(int n){\n        int re = 0;\n        while(n){re++;n/=10;}\n        return re;\n    }\n    void dopart(vector<string>
```\nclass Solution {\npublic:\n    int find(int n){\n        int re = 0;\n        while(n){re++;n/=10;}\n        return re;\n    }\n    void dopart(vector<string>& re,string s,int limit,int n){\n        int j = 0;\n        string k = to_string(n);\n        for(int i = 1; i<=n;++i){\n            int size = limit-(3+find(n)+find(i));\n            string temp;\n            while(size-- && j<s.size()){ temp+= string(1,s[j]); j++;}\n            temp+="<"+to_string(i)+"/"+k+">";\n            re.push_back(temp);\n        }\n    }\n    vector<string> splitMessage(string s, int limit) {\n        vector<string> re;\n        int n = s.size(),sum = 0; \n        for(int i = 1; i<=n;++i){\n            sum+=find(i);  // sum = lenght(1)+length(2)+...+length(i) \n            int size = 3*i + i*find(i) + sum;  // total size of string after adding all suffix\n            int last = 3 + 2*find(i);  // length of last suffix\n            if(last>limit) break;\n            int k = s.size()+size - limit*(i-1); // size of the last part of resulting string\n            if(k>=0 && k<=limit){  // check atmost limit condition for last last\n                dopart(re,s,limit,i);  // do partition of string \n                break;\n            }\n        }\n        return re;\n    }\n};\n```
['Math', 'C']