C++ || Greedy Approch && Reverse filling || O(n) time
\nclass Solution {\npublic:\n    string getSmallestString(int n, int k) {\n        \n        string res = "";\n        \n        while(n>0){\n           \n     
```\nclass Solution {\npublic:\n    string getSmallestString(int n, int k) {\n        \n        string res = "";\n        \n        while(n>0){\n           \n            for(int i=26;i>=1;i--){\n               \n               int rem = k-i;\n               if(rem >= n-1){\n                   char c = i-1+\'a\';\n                   res += c;\n                   k -= i;\n                   break;\n               }\n            }\n            n--;\n        }\n        reverse(res.begin(),res.end());\n        return res;\n    }\n};\n```
[]