boolean compare(String a, String b) {
        int count = 0;
        for (int i = 0; i < a.length(); i++) {
            if (a.charAt(i) != b.charAt(i))
                count++;
            if (count > 2)
                return false;
        }
        return count == 2;
    }
Why Did you create this class? what does it do?
src/problems/hard/SimilarStringGroups.java