Java Simple Solution with explanation
Imaging an array with length n and value between 1-26 representing the character values\nFill all slots with minimumr equirement a, then we have value k-a left\
Imaging an array with length n and value between 1-26 representing the character values\nFill all slots with minimumr equirement a, then we have value k-a left\nstart filling slots up to 26 (\'z\') fromt he end of the array, we can calculate with:\nnumber of \'z\' =  k%25\na single character with remaining value of k%25\nnumber of \'a\' = what ever left in the front\n\nthen the final String is number of \'a\' + single character + number of \'z\'\n   \n   public String getSmallestString(int n, int k) {\n        k = k-n;\n\n        int num = k/25;\n        int value = k%25;\n        \n        String result = "a".repeat(n-1-num);\n        result += String.valueOf((char)((int)\'a\'+value));\n        result += "z".repeat(num);\n\n\n        return result;\n    }
[]