java
\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n          int n = s.length();\n        int t = (int) Math.ceil(n * 1.0 / k);
```\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n          int n = s.length();\n        int t = (int) Math.ceil(n * 1.0 / k);\n        String[] res = new String[t];\n        int j = 0;\n        for (int i = 0; i < n; i += k) {\n            if (i + k >= n) {\n                res[j++] = s.substring(i, n);\n                break;\n            }\n            res[j++] = s.substring(i, i + k);\n        }\n        while (res[t - 1].length() < k) {\n            res[t - 1] += fill;\n        }\n        return res;\n    }\n}\n```
['Java']