Modified binary search
as it says make minimum splits as much as u can...\nso first try 1 to 9  , 10 to 99 , 100 to 999   ,  then 1000  to 9999  that\'s it\nso why doing this insted o
as it says make minimum splits as much as u can...\nso first try 1 to 9  , 10 to 99 , 100 to 999   ,  then 1000  to 9999  that\'s it\nso why doing this insted of making low=1 and high=10000 and apply once the problem here is the binary search solution works for numbers which have same digit  count \neg: \n"abbababbbaaa aabaa a"\n8\n\nhere if we just follow simple binary search with low=1 & high=10000 we end up on 11 but their is a solution at 7 splits which is better \nusual binary search fails to ensure the solution on range which have lesser digits than current mid\nso we need to search in ranges so why not jsut start from 1 to 9 best possible splits and if it fails then move forward \n**see the solve function implimentation**\nit will give us the correct value of spilts needed and then it\'s just easy problem just iterate and finished\n\n\n```\n\n class Solution {\npublic:\n    \n    string s="";\n    int limit=0;\n    bool safe(int m)\n    {\n        int n=s.size();\n        int c=to_string(m).size();\n        int t=1;\n        for(int i=1; i<=m; i++)\n        {\n            int tem=to_string(t).size();\n            t++;\n            n-=(limit-3-c-tem);\n        }\n        \n        if(n<=0) return true;\n        return false;\n    }\n    int solve(int l, int h)\n    {\n        int n=s.size();\n        \n        int ans=-1;\n        while(l<=h)\n        {\n            int m=l+((h-l)/2);\n            \n            if(safe(m))\n            {\n                // cout<<m<<endl;\n                ans=m;\n                h=m-1;\n            }\n            else l=m+1;\n        }\n        \n        if(ans==-1) // if answer not found\n        {\n            if(h>=n) return -1;\n            return solve(h+1, h*10+9);\n        }\n        else\n        return ans;\n    }\n    \n    vector<string> splitMessage(string s1, int t) \n    {\n        limit=t;\n        \n        if(t<=5) return {};\n        s=s1;\n        int p=solve(1,9);\n        \n        if(p==-1) return {};\n        // cout<<safe(7)<<endl;        \n        string left="/"+to_string(p)+">";\n        int c=left.size();  //constant\n        \n       \n        string second="";\n        int k=0;\n        \n        int rem=0;\n        \n        int n=s.size();\n        \n        vector<string> ans; \n        \n        for(int i=1; i<=p; i++)\n        {\n        \n            second="<"+ to_string(i)+left;\n            rem=(limit-(int)second.size());\n            if(rem==0) return {};//if no remaining space for char so return{} \n            \n             string tem="";\n            for(int j=0; j<rem; j++)// add remaining character\n            {\n                tem+=s[k];\n                k++;\n                if(k==n) break;\n            }\n            \n            tem+=second;\n            ans.push_back(tem);\n            \n            if(k==n) break;\n        }\n        return ans;\n        \n    }\n};\n\n```
['Greedy', 'Binary Search Tree', 'C']