public class LongestRepeatingCharacterReplacement {
    public int characterReplacement(String s, int k) {
        int ans = 0, max = 0, slow = 0;
        int[] counts = new int[128];
        for (int i = 0; i < s.length(); i++) {
            max = Math.max(max, ++counts[s.charAt(i)]);
            while (i - slow + 1 - max > k) {
                counts[s.charAt(slow)]--;
                slow++;
            }
            ans = Math.max(ans, i - slow + 1);
        }
        return ans;
    }

    public static void main(String[] args) {
        String s = "ABAB";
        int k = 2;

        System.out.printf("s = %s\n", s);
        System.out.printf("k = %d\n", k);
        LongestRepeatingCharacterReplacement solution = new LongestRepeatingCharacterReplacement();
        System.out.println(solution.characterReplacement(s, k));
    }
}
@@ -198,16 +198,22 @@
 int 
-i
+fast
  = 0; 
-i
+fast
  %3C s
@@ -223,17 +223,20 @@
 ngth(); 
-i
+fast
 ++) %7B%0A  
@@ -283,17 +283,20 @@
 .charAt(
-i
+fast
 )%5D);%0A   
@@ -311,17 +311,20 @@
  while (
-i
+fast
  - slow 
@@ -452,17 +452,20 @@
 ax(ans, 
-i
+fast
  - slow 

rename variable