java || Simple solution || O(n)
Assume we have n length of array with all \'a\', e.g. [\'a\', \'a\', \'a\'] for n = 3, k = 27. The total remaing is 27 - 3 = 24 now. Now we just need to allocat
Assume we have n length of array with all \'a\', e.g. [\'a\', \'a\', \'a\'] for n = 3, k = 27. The total remaing is 27 - 3 = 24 now. Now we just need to allocate the remaining numbers from right to left. Then iterate the array in reverse order, if larger than 25 (26 - 1),  we should allocate \'z\', otherwise we should allocate the remaining. The rest part should all be \'a\'s.\n```\nclass Solution {\n    public String getSmallestString(int n, int k) {\n        char[] list = new char[n];\n        k -= n;\n        for (int i = n - 1; i >= 0 ; i--) {\n            if (k > 25) {\n                k -= 25;\n                list[i] = \'z\';\n            } else {\n                list[i] = (char)(97 + k);\n                k = 0;\n            }\n        }\n        return String.valueOf(list);\n    }\n}\n```
['Java']