sliding window
\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int mc) {\n        int i = 0;\n        int j = 0;\n        int n = s.length();\n        
```\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int mc) {\n        int i = 0;\n        int j = 0;\n        int n = s.length();\n        int cc= 0,res = 0;\n        while(j<n)\n        {\n            cc += abs(s[j]-t[j]);\n            while(cc>mc)\n            {\n                cc -= (abs(s[i]-t[i]));\n                i++;\n            }\n            res = max(res,j-i+1);\n            j++;\n        }\n        \n        return res;\n        \n    }\n};\n```
['C']