simple and easy Sliding Window solution 😍❤️‍🔥
if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) \n    {\n  
# if it\'s help, please up \u2B06 vote! \u2764\uFE0F\n\n\n# Code\n```\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) \n    {\n        int i = 0, j = 0;\n        int ans = 0, cost = 0, n = s.size();\n        while(j<n)\n        {\n            cost += abs(s[j] - t[j++]);\n            while(cost > maxCost) cost -= abs(s[i] - t[i++]);\n            ans = max(ans, j-i);\n        }\n        return ans;\n    }\n};\n```
['String', 'Sliding Window', 'C++']