Java-2ms-0(n)
\tfirst append the fill at the end of str based on the length of str\n* \tdivide into k length\n\t\n\t    public String[] divideString(String str, int k, char f
* \tfirst append the fill at the end of str based on the length of str\n* \tdivide into k length\n\t\n\t    public String[] divideString(String str, int k, char fill) {\n\t        \n\t    \t// return if k and str are same\n\t    \tif (str.length() == k)\n\t\t\t\treturn new String[] { str };\n\n\t\t\tint index = 0;\n\t\t\tint stringLength = str.length();\n\t\t\tStringBuilder sb = new StringBuilder(str);\n\t\t\t\n\t\t\t// find size of array creation\n\t\t\tString[] strArr = (stringLength % k == 0) ? new String[stringLength / k] : new String[(stringLength / k) + 1];\n\n\t\t\t//append fill after str \n\t\t\tif (stringLength % k != 0) {\n\t\t\t\tfor (int i = 0; i < k - (stringLength % k); i++) {\n\t\t\t\t\tsb.append(fill);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//divide into k\n\t\t\tfor (int i = 0; i < sb.length(); i += k) {\t\t\t\n\t\t\t\tstrArr[index] = (sb.substring(i, i + k));\n\t\t\t\t++index;\n\n\t\t\t}\n\n\t\t\treturn strArr;\n\t
['Java']