Simple Java  Code
Idea is simple, we will make the string from end greedily i.e, putting the lexographically biggest possible character. Here is my code \n\n\nclass Solution {\n 
Idea is simple, we will make the string from end greedily i.e, putting the lexographically biggest possible character. Here is my code \n\n```\nclass Solution {\n    public String getSmallestString(int n, int k) {\n        StringBuilder sb=new StringBuilder("");\n        for(int i=0;i<n;i++){\n            int val=k-(n-i-1);\n            if(val>26)val=26;\n            k=k-val;\n            sb.append((char)(96+val));\n        }\n        return sb.reverse().toString();\n    }\n}\n```
['Greedy']