classSolution {publicintequalSubstring(String s,String t,int maxCost) {int sum =0;int left =0;int result =0;for (int right =0; right <s.length(); right++) { sum +=Math.abs((s.charAt(right) -'a') - (t.charAt(right) -'a'));;while (left <= right && sum > maxCost) { sum -=Math.abs((s.charAt(left) -'a') - (t.charAt(left) -'a'));; left++; } result =Math.max(result, right - left +1); }return result; }}/**maxCost = 0 x r abcdbcdf lr - l + 1 = 0 r abcdbcdf lendT: O(n)S: O(1) */