✅EASY AND SIMPLE SOLUTION✅
\n\n# Code\n\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) {\n        int start = 0;\n        int cost = 0;\n        int m
\n\n# Code\n```\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) {\n        int start = 0;\n        int cost = 0;\n        int max_length = 0;\n\n        for (int i = 0; i < s.size(); i++) {\n            cost = cost + abs(s[i] - t[i]);\n\n            while (cost > maxCost) {\n                cost = cost - abs(s[start] - t[start]);\n                start++;\n            }\n\n            max_length = max(max_length, i - start + 1);\n        }\n\n        return max_length;\n    }\n};\n```
['C++']