3106. Lexicographically Smallest String After Operations With Constraint
IntuitionApproachComplexity
Time complexity:

Space complexity:
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)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```dart []
class Solution {
  String getSmallestString(String s, int k) {
    String finalResult = '';
    for (int i = 0; i < s.length; i++) {
      int value = s.codeUnitAt(i) - 'a'.codeUnitAt(0);
      int minChange = value < (26 - value) ? value : (26 - value);
      if (minChange <= k) {
        k -= minChange;
        finalResult += 'a';
      } else {
        finalResult += String.fromCharCode(value + 'a'.codeUnitAt(0) - k);
        break;
      }
    }
    return finalResult + s.substring(finalResult.length);
  }
}
```
['Dart']