@@ -0,0 +1,547 @@
+// http://codingbat.com/prob/p159772%0A%0Apublic boolean xyzMiddle(String str) %7B%0A  if (!str.contains(%22xyz%22)) %7B%0A    return false;%0A  %7D%0A%0A  for (int xyzIndex = str.indexOf(%22xyz%22); %0A       xyzIndex %3E= 0; %0A       xyzIndex = str.indexOf(%22xyz%22, xyzIndex + 3)) %0A  %7B%0A    int leftSubstringLength = str.substring(0, xyzIndex).length();%0A    int rightSubstringLength = str.substring(xyzIndex + 3).length();%0A    boolean isInMiddle = (Math.abs(leftSubstringLength - rightSubstringLength) %3C= 1);%0A    if (isInMiddle) %7B%0A      return true;%0A    %7D%0A  %7D%0A  %0A  return false;%0A%7D%0A

Create xyzMiddle.java