EASY C++ SOLUTION 🚀🔥 || SIMPLE FORCE APPROACHWITH DRY RUN  ✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n1. Initialize a string 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Initialize a string t with the same characters as string s.\n2. Iterate over each character in string s.\n3. For each character, iterate over the lowercase English letters from \'a\' to \'z\'.\n4. Calculate the minimum distance required to change the character in s to the current letter \'ch\'.\n-  For each character, we try all possible lowercase English letters from \'a\' to \'z\' to find the lexicographically smallest letter that satisfies the distance constraint.\n\nWe calculate the distance between the current character s[i] and the candidate letter ch in three cases:\n\n- Direct distance: abs(s[i] - ch)\n- Distance when ch is after s[i] in cyclic order: s[i] + 26 - ch\n- Distance when ch is before s[i] in cyclic order: ch + 26 - s[i]\n\nWe choose the candidate letter ch that minimizes the distance and satisfies the distance constraint (i.e., the distance is less than or equal to k)\n5. If the distance is less than or equal to the allowed value k, update the character in the resulting string t.\n6. Subtract the distance from k.\n7. Move to the next character in string s.\n8. Return the resulting string t.\n\n\n**DRY RUN**\nStarting with s = "xaxcd" and k = 4, we\'ll iterate over each character in the string:\n\n1. For the first character \'x\':\n- The minimum distance to change \'x\' to \'a\' is 23.\n- Since 23 > 4, we do not update t.\n\n2. For the second character \'a\':\n- The minimum distance to change \'a\' to \'w\' is 3.\n- Since 3 <= 4, we update t to "waxcd" and decrement k to 1.\n\n3. For the third character \'x\':\n- The minimum distance to change \'x\' to \'a\' is 23.\n- Since 23 > 1, we do not update t.\n\n4. For the fourth character \'c\':\n - The minimum distance to change \'c\' to \'a\' is 2.\n- Since 2 <= 1, we update t to "waacd" and decrement k to 0.\n\n5. For the fifth character \'d\':\n- The minimum distance to change \'d\' to \'a\' is 3.\n- Since 3 > 0, we do not update t.\n\nFinally, we return t, which is "waacd".\n\n# Complexity\n- Time complexity: **O( N )**\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: **O( N )**\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string getSmallestString(string s, int k) {\n        int n = s.size(); // Length of the string\n        string t = s; // Initialize the resulting string with the original string\n\n        // Iterate over each character in the string\n        for (int i = 0; i < n; ++i) {\n            // Iterate over each lowercase English letter (\'a\' to \'z\')\n            for (char ch = \'a\'; ch <= \'z\'; ++ch) {\n                // Calculate the minimum distance to change s[i] to ch\n                int dist = min(abs(s[i] - ch), min(s[i] + 26 - ch, ch + 26 - s[i]));\n                // If the distance is within the allowed value k, update the character in the resulting string\n                if (dist <= k) {\n                    t[i] = ch;\n                    // Reduce k by the distance changed\n                    k -= dist;\n                    // Move to the next character in the original string\n                    break; \n                }\n            }\n        }\n        return t; \n    }\n};\n```
['String', 'Greedy', 'C++']