simple java solution
\nclass Solution {\n    public String getSmallestString(int n, int k) {\n        char[] res = new char[n];\n        Arrays.fill(res,\'a\'); // filling the whole
```\nclass Solution {\n    public String getSmallestString(int n, int k) {\n        char[] res = new char[n];\n        Arrays.fill(res,\'a\'); // filling the whole array with starting alphabet a\n        \n        // now update the k as we have fill the array with  character a\n        k = k-n;\n        \n        while(k>0)\n        {\n            res[n-1] += Math.min(25, k); // like this-- a+25 = z\n            n--;\n            k = k- Math.min(25,k);\n        }\n        \n        return String.valueOf(res);\n    }\n}\n```
[]