@@ -0,0 +1,864 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0A/**%0A*   Solution to https://www.hackerrank.com/challenges/alternating-characters/%0A*/%0Apublic class Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A%0A        int tests = readInt(in);%0A%0A        for (int test = 0; test %3C tests; test++) %7B%0A            String line = in.nextLine().trim();%0A            char%5B%5D c = line.toCharArray();%0A%0A            int n = line.length();%0A%0A            int deletes = 0;%0A            for (int i = 0; i %3C n - 1; i++) %7B%0A                if (c%5Bi%5D == c%5Bi + 1%5D) %7B%0A                    deletes++;%0A                %7D%0A            %7D%0A%0A            System.out.println(deletes);%0A        %7D%0A    %7D%0A%0A    private static int readInt(Scanner in) %7B%0A        return Integer.parseInt(in.nextLine().trim());%0A    %7D%0A%7D%0A

Create alternating-characters.java