✅✅C++ USING SLIDING WINDOW|| EASY TO UNDERSTAND✅✅
\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxc) {\n       int sum=0,i=0,j=0,ans=0;\n        while(j<s.size())\n        {\n    
```\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxc) {\n       int sum=0,i=0,j=0,ans=0;\n        while(j<s.size())\n        {\n            int a = s[j]-\'a\';\n            int b = t[j]-\'a\';\n           sum+=  abs(a-b);\n           if(sum<=maxc)\n           {\n               j++;\n               ans = max(ans,(j-i));\n           }\n            else if(maxc<sum)\n            {\n                while(maxc<sum)\n                {\n                    int x  = s[i]-\'a\';\n                    int y = t[i]-\'a\';\n                    sum-=abs(x-y);\n                    i++;\n                }\n                j++;\n            }\n        }\n        return ans;\n    }\n};\n```
['C', 'C++']