public boolean isScramble(String s1, String s2) {
		if (s1.equals(s2)) {
			return true;
		}
		char[] one = s1.toCharArray();
		char[] two = s2.toCharArray();
		Arrays.sort(one);
		Arrays.sort(two);
		if (!Arrays.equals(one, two)) {
			return false;
		}
		int len = s1.length();
		for (int i = 1; i < len; i++) {
			String s1Left = s1.substring(0, i);
			String s1Right = s1.substring(i);
			String s2Left = s2.substring(0, i);
			String s2Right = s2.substring(i);
			if (isScramble(s1Left, s2Left) && isScramble(s1Right, s2Right)) {
				return true;
			}
			s2Left = s2.substring(0, len - i);
			s2Right = s2.substring(len - i);
			if (isScramble(s1Left, s2Right) && isScramble(s1Right, s2Left)) {
				return true;
			}
		}
		return false;
	}