StringBuilder to track return string, loop chars to check if it can be changed lower
IntuitionApproachComplexity
Time complexity:
O(N)
Space complexity:
O(N)Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->
O(N)
- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->
O(N)
# Code
```csharp []
public class Solution {
    public string GetSmallestString(string s, int k) {
        int len = s.Length;
        StringBuilder sb = new StringBuilder(s);
        int start = 0;
        while(start < len && k > 0)
        {
            char c = s[start];
           // Console.WriteLine($"before cal k is {k}");
            if(c != 'a')
            {
                int idx = c - 'a';
                int minDiff = Math.Min(idx, 26-idx);
              //  Console.WriteLine($"k: {k}, minDiff: {minDiff}");
                if(k >= minDiff)
                {
                    sb[start] = 'a';
                    k -= minDiff;
                }
                else
                {
                    sb[start] = ((char)((idx-k) + 'a'));
                    k = 0;
                }
            }

            start++;
           //  Console.WriteLine($"after cal k is {k}");
        }

        return sb.ToString();
    }
}
```
['C#']