Java Code
\nclass Solution {\n    public String getSmallestString(int n, int k) {\n        char[] c = new char[n];\n        \n        for(int i = n-1; i>=0; i--){\n      
```\nclass Solution {\n    public String getSmallestString(int n, int k) {\n        char[] c = new char[n];\n        \n        for(int i = n-1; i>=0; i--){\n            int val = Math.min(26,k - i);\n            c[i] = (char)(\'a\'+val-1); //using (char) to convert ASCII to respective character\n            k=k-val;\n        }\n        return new String(c);\n    }\n}\n```
['Greedy']