c++
1) Traverse through the string with increments of k(i=i+k).\n2) Take substrings from ith index of length k, and push in the vector\n3) If substring is not of le
1) Traverse through the string with increments of k(i=i+k).\n2) Take substrings from ith index of length k, and push in the vector\n3) If substring is not of length k, keep on adding fill(char) till length become k\n```\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        vector<string> vec;\n        string temp;\n        int n=s.length();\n        for(int i=0;i<n;i+=k){\n            temp=s.substr(i,k);\n            if(temp.length()==k){\n                vec.push_back(temp);\n            }\n            else{\n                while(temp.length()!=k){\n                    temp += fill;\n                }\n                vec.push_back(temp);\n            }\n        }\n        return vec;\n    }\n};
['String', 'C']