im trying to do this probelm "Check to see if a string has the same amount of 'x's and 'o's. The method must return a boolean and be case insensitive. The string can contain any char."
However i am failing a few tests so i am wondering is there a better way of doing this?
public class XO {
public static boolean getXO (String str) {
boolean Boolean = false;
String[] x = str.split("x");
String[] o = str.split("o");
// Good Luck!!
if(x.length == o.length){
Boolean = true;
}
return Boolean;
}
}