<awangdev>221. Maximal Square_1.java
public int maximalSquare(char[][] matrix) {
        if (matrix == null || matrix.length == 0 || matrix[0] == null || matrix[0].length == 0) return 0;
        int m = matrix.length, n = matrix[0].length;
        int[][] dp = new int[m + 1][n + 1];
        int maxLen = 0;
       
        for (int i = 1; i <= m; i++) {
            for (int j = 1; j <= n; j++) {
                if (matrix[i - 1][j - 1] == '0') continue;
                dp[i][j] = Math.min(Math.min(dp[i][j-1], dp[i-1][j]), dp[i-1][j-1]) + 1;
                maxLen = Math.max(maxLen, dp[i][j]);
            }
        }
        return maxLen * maxLen;
    }
public int sample_funcname ( char [ ] [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 || var_0 [ 0 ] == null || var_0 [ 0 ] . length == 0 ) return 0 ;
  int var_4 = var_0 . length , var_5 = var_0 [ 0 ] . length ;
  int [ ] [ ] var_7 = new int [ var_4 + 1 ] [ var_5 + 1 ] ;
  int var_8 = 0 ;
  for ( int var_9 = 1 ;
  var_9 <= var_4 ;
  var_9 ++ ) {
    for ( int var_10 = 1 ;
    var_10 <= var_5 ;
    var_10 ++ ) {
      if ( var_0 [ var_9 - 1 ] [ var_10 - 1 ] == '0' ) continue ;
      var_7 [ var_9 ] [ var_10 ] = Math . min ( Math . min ( var_7 [ var_9 ] [ var_10 - 1 ] , var_7 [ var_9 - 1 ] [ var_10 ] ) , var_7 [ var_9 - 1 ] [ var_10 - 1 ] ) + 1 ;
      var_8 = Math . max ( var_8 , var_7 [ var_9 ] [ var_10 ] ) ;
    }
  }
  return var_8 * var_8 ;
}
