class Solution {
public String[] divideString(String s, int k, char fill) {
int len = s.length();
int size = len/k;
int remain = len%k;
List<String> resList = new ArrayList<>();
int ksize = 0;
for (int i = 0; i < size; i++) {
resList.add(s.substring(0 + ksize, k + ksize));
ksize += k;
}
if (remain != 0) {
resList.add(s.substring(size*k, len) + String.valueOf(fill).repeat(k - remain));
}
String[] res = new String[resList.size()];
for (int i = 0; i < resList.size(); i++) {
res[i] = resList.get(i);
}
return res;
}
}