@@ -0,0 +1,1157 @@
+package codingbat.string3;%0A%0A/*%0A * Given a string, return true if the number of appearances of %22is%22 anywhere %0A * in the string is equal to the number of appearances of %22not%22 anywhere %0A * in the string (case sensitive). %0A * %0A * equalIsNot(%22This is not%22) = false%0A * equalIsNot(%22This is notnot%22) = true%0A * equalIsNot(%22noisxxnotyynotxisi%22) = true %0A * %0A */%0A%0Apublic class EqualIsNotTest %7B%0A%0A  public static void main(String%5B%5D args) %7B%0A    EqualIsNotTest test = new EqualIsNotTest();%0A%0A    System.out.println(%22%3E%22 + test.equalIsNot(%22This is not%22) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.equalIsNot(%22This is notnot%22) + %22%3C%22);%0A    System.out.println(%22%3E%22 + test.equalIsNot(%22noisxxnotyynotxisi%22) + %22%3C%22);%0A  %7D%0A%0A  public boolean equalIsNot(String str) %7B%0A    int is = 0;%0A    int not = 0;%0A    %0A    for (int i = 0; i %3C str.length()-1; i++) %7B%0A      String teststring = str.substring(i, i+2);%0A      %0A      if (teststring.equals(%22is%22)) %7B%0A        is += 1;%0A      %7D%0A    %7D%0A    %0A    for (int i = 0; i %3C str.length()-2; i++) %7B%0A      String teststring = str.substring(i, i+3);%0A      %0A      if (teststring.equals(%22not%22)) %7B%0A        not += 1;%0A      %7D%0A    %7D%0A    %0A    return is == not;%0A  %7D%0A%0A%7D%0A

add task equalIsNot