boolean isScramble(String strA, String strB)
	{
	    if (strA.length() != strB.length()) 
	        return false;
	    
	    if (strA.equals(strB))
	        return true;
	    int n = strA.length();
	    for (int i = 1; i < strA.length(); i++)
	    {
	        if ( isScramble(strA.substring(0, i), strB.substring(0, i)) &&
	        		isScramble(strA.substring(i), strB.substring(i)))
	            return true;

	        if (isScramble(strA.substring(0, i), strB.substring(n-i)) &&
	        		isScramble(strA.substring(n-i), strB.substring(0,i)))
	            return true;
	    }

	    return false;
	}