c++ || very simple solution || O(N)
PLEASE UPVOTE IF IT HELPS YOU\n\nclass Solution {\npublic:\n    string getSmallestString(int n, int k) {\n        { \n    string arr = ""; \n  \n    for(int i =
**PLEASE UPVOTE IF IT HELPS YOU**\n```\nclass Solution {\npublic:\n    string getSmallestString(int n, int k) {\n        { \n    string arr = ""; \n  \n    for(int i = 0; i < n; i++) \n        arr += \'a\'; \n    for (int i = n - 1; i >= 0; i--) \n    { \n        k -= i; \n        if (k >= 0) \n        { \n            if (k >= 26) \n            { \n                arr[i] = \'z\'; \n                k -= 26; \n            } \n            else\n            { \n                char c= (char)(k + 97 - 1); \n                arr[i] = c; \n                k -= arr[i] - \'a\' + 1; \n            } \n        } \n  \n        else\n            break; \n  \n        k += i; \n    } \n    return arr; \n    }\n        \n    }\n};\n```
['String', 'C']