Easiest Java || one Loop || Simple decision
PLEASE UPVOTE IF LIKE \uD83D\uDE0A \n\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n        //First Get the given string le
## PLEASE UPVOTE IF LIKE \uD83D\uDE0A \n```\nclass Solution {\n    public String[] divideString(String s, int k, char fill) {\n        //First Get the given string length\n        int n = s.length();\n        \n        //Check if string would have its fixed length or not\n        // fixed length means, there is no requirement to add the \'fill\' character\n        // possibly for last answer arrayString\n        boolean hasFixed = (n%k==0);\n        \n        // Now decide the length of result array of string based upon hasFixed flag\n        int newSize = n/k + (hasFixed? 0:1);\n        \n        //Create ans array\n        String result[] = new String[newSize];\n        \n        // index to filling the ans array from begining(0-index)\n        int index = 0;\n        \n        // start the loop, based upon the flag\n        // here going with n, means we have all fixed answer array without any fill char\n        // else go upto n-k,\n        // See example 1 and 2 of description\n        for(int i=0;i<(hasFixed?n:n-k);i+=k){\n            result[index++] = s.substring(i,k+i);\n        }\n        \n        // If flag is not fixed array size based upon parameter k, look for the remaining char\n        // which was not selected from above loop\n        if(!hasFixed){\n            \n            //Create the last one,\n            result[index] = s.substring((n/k)*k);\n            \n            // Now append the fill char for the remaining place\n            for(int i=0;i<k-n%k;i++)\n                result[index] +=""+fill;\n        }\n        \n        // return the result array\n        return result;\n    }\n}\n```
['Counting']