C# - O(N) - Fill array from end
csharp\npublic string GetSmallestString(int n, int rem)\n{\n\t char[] result = new char[n];\n\t Array.Fill(result, \'a\');\n\n\t // We have already filled array
```csharp\npublic string GetSmallestString(int n, int rem)\n{\n\t char[] result = new char[n];\n\t Array.Fill(result, \'a\');\n\n\t // We have already filled array with \'a\' with value 1 for each char\n\t rem -= n;\n\n\t for(int i = n - 1; i >= 0; i--)\n\t {\n\t\t int diff = Math.Min(rem, 25);\n\t\t result[i] = (char)(\'a\' + diff);\n\t\t rem -= diff;\n\t }\n\n\t return new string(result);\n}\n```
[]