C++|| Probably the easiest way to solve this
\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        int n=s.size();\n        \n        int c=0;\n        vector<
```\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        int n=s.size();\n        \n        int c=0;\n        vector<string>ans;\n        string a;\n        for(int i=0;i<n;i++){\n            if(c<k){\n\t\t\t\t//we fill the string till the size becomes equal to the required size\n                a.push_back(s[i]);\n                c++;\n            }\n            if(c==k){\n\t\t\t// we dont want want to keep adding characters to our string a when count>k\n\t\t\t//therefore we push a into our ans vector and reset everything for the next k characters\n                c=0;\n                ans.push_back(a);\n                a.erase();\n            }\n        }\n        int req=0;\n\t\t//now in the last k character slot, if count!=k, then it will never erase the string a\n\t\t// therefore, we can use that to satisfy the fill condition.\n        if(a.size()!=0){\n            req=k-a.size();\n        \n            while(req--){\n                a.push_back(fill);\n            }\n            ans.push_back(a);\n        }\n        return ans;\n    }\n};\n```
[]