[C++] Good String Implementation question for beginners | Intuitive
\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        int n = s.length();\n        vector<string> ans;\n        \n
```\nclass Solution {\npublic:\n    vector<string> divideString(string s, int k, char fill) {\n        int n = s.length();\n        vector<string> ans;\n        \n        string curr = "";\n        for(int i=0; i<n; i++){\n            curr.push_back(s[i]);\n            if(curr.size() == k){\n                ans.push_back(curr);\n                curr = "";\n            }\n        }\n        if(curr.size() > 0){\n            while(curr.size() != k){\n                curr.push_back(fill);\n            }\n            ans.push_back(curr);\n        }\n        return ans;\n        \n    }\n};\n```
['String', 'C', 'C++']