Java solution
\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n        int i = 0, j = 0, len = s.length();\n        \n        int groupCoun
```\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n        int i = 0, j = 0, len = s.length();\n        \n        int groupCount = len % k == 0 ? len / k : len / k + 1;\n        var result = new String[groupCount];\n        \n        while (i + k < len) {\n            result[j++] = s.substring(i, i + k);\n            i += k;\n        }\n        var last = s.substring(i);\n        last += String.valueOf(fill).repeat(i + k - len);\n        result[j] = last;\n        return result;\n    }\n}\n```
['Java']