Very fast easy to understand solution
\n public int equalSubstring(String s1, String s2, int maxCost) {\n        int []arr = new int[s1.length()];\n        for(int i=0;i<s1.length();i++){\n         
```\n public int equalSubstring(String s1, String s2, int maxCost) {\n        int []arr = new int[s1.length()];\n        for(int i=0;i<s1.length();i++){\n            arr[i] = Math.abs(s1.charAt(i)-s2.charAt(i)); \n        }\n        int i=0,j=0,sum=0,max=0;\n\n        while(i<arr.length && j<arr.length){\n            sum += arr[j++];\n            if(sum<=maxCost){\n                max = Math.max(max,j-i);\n            }else{\n                while(sum>maxCost){\n                    sum -= arr[i++];\n                }\n            }\n        }\n        return max;\n    }\n```
['Sliding Window', 'Java']