C++ 0 ms Solution
\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        \n        vector<string> res;\n        \n        for(int i =
```\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        \n        vector<string> res;\n        \n        for(int i = 0; i < s.size(); i += k){\n            res.push_back(s.substr(i, k));\n        }\n        string last_str = res.at(res.size()-1);\n        \n        while (last_str.size() != k) {\n            last_str.push_back(fill);\n        }\n        res[res.size()-1] = last_str;\n       \n        return res;\n    }\n};\n```\n![image](https://assets.leetcode.com/users/images/613e5e9e-521e-45f5-bf0b-ed2c961cfb39_1642498551.0331402.png)\n
['C++']