@@ -0,0 +1,792 @@
+//https://www.hackerrank.com/challenges/alternating-characters%0Aimport java.io.*;%0A%0Apublic class Solution %7B%0A    public static void main(String%5B%5D args) throws IOException%7B%0A        StringBuffer sb = new StringBuffer();%0A        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));%0A%0A        //For each test case%0A        for(byte T = Byte.parseByte(br.readLine()); T %3E 0; --T)%7B%0A%0A            //Solve%0A            sb.append(getMinDeletions(br.readLine().toCharArray()) + %22%5Cn%22);%0A        %7D%0A        System.out.print(sb);%0A    %7D%0A    %0A    private static int getMinDeletions(final char%5B%5D S)%7B%0A        int deletions = 0;%0A        for(int i = 1, N = S.length; i %3C N; ++i)%7B%0A            if(S%5Bi%5D == S%5Bi-1%5D)%7B%0A                ++deletions;%0A            %7D%0A        %7D%0A        return deletions;%0A    %7D%0A%7D%0A

Create alternating-characters.java