<awangdev>Scramble String_2.java
public boolean isScramble(String s1, String s2) {
        if (s1 == null || s2 == null || s1.length() != s2.length()) {
            return false;
        }
        int n = s1.length();
        boolean[][][] dp = new boolean[n][n][n + 1];
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                dp[i][j][1] = s1.charAt(i) == s2.charAt(j);
            }
        }

        for (int len = 2; len <= n; len++) {
            for (int i = 0; i <= n - len; i++) {
                for (int j = 0; j <= n - len; j++) {
                    for (int w = 1; w < len; w++) {
                        dp[i][j][len] |= (dp[i][j][w] && dp[i + w][j + w][len - w]);
                        dp[i][j][len] |= (dp[i][j + len - w][w] && dp[i + w][j][len - w]);
                    }
                }
            }
        }
        return dp[0][0][n];
    }
public boolean var_0 ( String var_2 , String var_3 ) {
  if ( var_2 == null || var_3 == null || var_2 . length ( ) != var_3 . length ( ) ) {
    return false ;
  }
  int var_6 = var_2 . length ( ) ;
  boolean [ ] [ ] [ ] var_9 = new boolean [ var_6 ] [ var_6 ] [ var_6 + 1 ] ;
  for ( int var_11 = 0 ;
  var_11 < var_6 ;
  var_11 ++ ) {
    for ( int var_12 = 0 ;
    var_12 < var_6 ;
    var_12 ++ ) {
      var_9 [ var_11 ] [ var_12 ] [ 1 ] = var_2 . charAt ( var_11 ) == var_3 . charAt ( var_12 ) ;
    }
  }
  for ( int var_15 = 2 ;
  var_15 <= var_6 ;
  var_15 ++ ) {
    for ( int var_11 = 0 ;
    var_11 <= var_6 - var_15 ;
    var_11 ++ ) {
      for ( int var_12 = 0 ;
      var_12 <= var_6 - var_15 ;
      var_12 ++ ) {
        for ( int var_16 = 1 ;
        var_16 < var_15 ;
        var_16 ++ ) {
          var_9 [ var_11 ] [ var_12 ] [ var_15 ] |= ( var_9 [ var_11 ] [ var_12 ] [ var_16 ] && var_9 [ var_11 + var_16 ] [ var_12 + var_16 ] [ var_15 - var_16 ] ) ;
          var_9 [ var_11 ] [ var_12 ] [ var_15 ] |= ( var_9 [ var_11 ] [ var_12 + var_15 - var_16 ] [ var_16 ] && var_9 [ var_11 + var_16 ] [ var_12 ] [ var_15 - var_16 ] ) ;
        }
      }
    }
  }
  return var_9 [ 0 ] [ 0 ] [ var_6 ] ;
}
