Explaination || Greedy with proof
Since the constraints on k are suitable, we need not worry about edge cases.\nIntuition:\nlets say we have n spaces and k sum\n____________\nlets fill i=0, for 
Since the constraints on k are suitable, we need not worry about edge cases.\n**Intuition**:\nlets say we have **n spaces and k sum**\n____________________________________________________________\nlets **fill i=0**, for every position **we have to fill the smallest alphabet possible such that after filling that alphabet we can still reach k**. In short after filling i=0, the maximum reachable sum should be gr**eater than or equal to k.**\nlet the value of character filled be **\'x\'** , after filling this the length left with us is **n-i-1**; so acc to prev statement\n\n>**x + 26*(n-i-1) >= k*\n> **x >= k - 26*(n-i-1)* \n\nWe will always pick equality condition since we need lexicographically smalles characters\n**if we get RHS<1,  we will take 1 as we have > inequality.**\n\nHope it helps Do upvote :)\n```\nclass Solution {\npublic:\nstring getSmallestString(int n, int k) {\n\tstring ans = "";\n\tfor (int i = 0; i < n; i++) {\n\t\tint val = max(k - 26 * (n-i-1) ,1);\n\t\tans.push_back(val -1 + \'a\');\n\t\tk -= val;\n\t}\n\treturn ans;\n}\n\n};\n```
[]