c++ || easiest
\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) {\n\t\n        int n=s.size(),arr[n];\n\t\t\n        for(int i=0;i<n;i++)\n
```\nclass Solution {\npublic:\n    int equalSubstring(string s, string t, int maxCost) {\n\t\n        int n=s.size(),arr[n];\n\t\t\n        for(int i=0;i<n;i++)\n            arr[i]=abs(s[i]-t[i]);\n        \n        int cost=0,start=0,maxlen=INT_MIN;\n\t\t\n        for(int i=0;i<n;i++){\n            cost+=arr[i];\n        \n            while(cost>maxCost)\n                cost-=arr[start++];\n        \n            maxlen=max(maxlen,i-start+1);\n        }\n        return maxlen;\n    }\n};\n```\n**Feel free to ask any question in the comment section.**\nI hope that you\'ve found the solution useful.\nIn that case, **please do upvote and encourage me** to on my quest to document all leetcode problems\uD83D\uDE03\nHappy Coding :)\n
['C', 'C++']