Java Solution in just 2 ms
Code\n\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n        //the size of result array\n        String[] r = new String[(i
# Code\n```\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n        //the size of result array\n        String[] r = new String[(int) Math.ceil((s.length() * 1.0) / k)];\n        int idx;\n        //if the last one needs to be filled, then I do it\n        if (s.length() % k != 0) {\n            idx = s.length() - (s.length() % k);\n            StringBuilder sb = new StringBuilder();\n            sb.append(s.substring(idx));\n            for (int i = sb.length(); i < k; i++) {\n                sb.append(fill);\n            }\n            r[r.length - 1] = sb.toString();\n        } else {\n            //no need to fill the last, \n            //that\'s why idx is equal to s length\n            idx = s.length();\n        }\n        for (int i = 0; i < idx; i+=k) {\n            r[i / k] = s.substring(i, i + k);\n        }\n        \n        return r;\n    }\n}\n```
['Java']