[c++ /javascript ] solution
\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) \n    {\n        int n=s.size();\n        vector<string>v;\n        for
```\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) \n    {\n        int n=s.size();\n        vector<string>v;\n        for(int i=0;i<n;i+=k)\n        {\n            v.push_back(s.substr(i,k));\n        }\n        if(v.back().size()==k)\n        {\n            return v;\n        }\n        for(int i=v.back().size();i<k;i++)\n        {\n            v.back()+=fill;\n        }\n        return v;\n    }\n};\n```\n\n```\n/**\n * @param {string} s\n * @param {number} k\n * @param {character} fill\n * @return {string[]}\n */\nvar divideString = function(s, k, fill) \n{\n  var ans=[];\n  for(let i=0;i<s.length;i+=k)\n    {\n      ans.push(s.substring(i,i+k));\n    }\n  let str=ans[ans.length-1];\n  if(str.length==k)\n    {\n      return ans;\n    }\n  for(let i=str.length;i<k;i++)\n    {\n      ans[ans.length-1]+=fill;\n    }\n  return ans;\n};\n```
['String', 'C', 'C++', 'JavaScript']