[C++] Brute force with O(N) time complexity
\nclass Solution {\npublic:\n    int digits(int n) {\n        int cnt = 0;\n        while (n) {\n            n /= 10;\n            cnt++;\n        }\n        re
```\nclass Solution {\npublic:\n    int digits(int n) {\n        int cnt = 0;\n        while (n) {\n            n /= 10;\n            cnt++;\n        }\n        return cnt;\n    }\n    vector<string> splitMessage(string message, int limit) {\n        int n = message.size();\n        for (int length = 1; length * 2 + 3 < limit; ++length) {\n            int cnt = (pow(10, length) - 1);\n            int available = cnt * limit;\n            available -= 3 * cnt;\n            available -= length * cnt;\n            for (int i = 1; i <= length; ++i) {\n                available -= i * (pow(10, i) - pow(10, i - 1));\n            }\n            if (available >= n) return generate(message, limit, length);\n        }\n        \n        return {};\n    }\n    vector<string> generate(string& message, int limit, int length) {\n        int n = message.size();\n        vector<string> res;\n        int index = 0;\n        int cnt = 1;\n        while (index < n) {\n            int remain = limit - 3;\n            remain -= digits(cnt);\n            remain -= length;\n            int extract = min(remain, n - index);\n            string temp = message.substr(index, extract) + "<" + to_string(cnt) + "/";\n            res.push_back(temp);\n            index += extract;\n            cnt++;\n        }\n        string blockCnt = to_string(cnt - 1);\n        for (auto& word : res) {\n            word += blockCnt + ">";\n        }\n        return res;\n    }\n};\n\n```
['C', 'Binary Tree']