comefrom: <qiyuangong>221_Maximal_Square_2.py
code: def maximalSquare( matrix):
      if matrix is None or len(matrix) == 0:
          return 0
      rows, cols, res = len(matrix), len(matrix[0]), 0
      dp = [[0] * (cols + 1) for _ in range(rows + 1)]
      for i in range(1, rows + 1):
          for j in range(1, cols + 1):
              if matrix[i - 1][j - 1] == '1':
                  dp[i][j] = min(dp[i][j - 1], dp[i - 1][j], dp[i - 1][j - 1]) + 1
                  res = max(res, dp[i][j])
      return res * res
masked: def sample_funcname ( var_0 ) :
      if var_0 is None or len ( var_0 ) == 0 :
          return 0
      var_1 , var_2 , var_3 = len ( var_0 ) , len ( var_0 [ 0 ] ) , 0
      var_5 = [ [ 0 ] * ( var_2 + 1 ) for var_4 in range ( var_1 + 1 ) ]
      for var_6 in range ( 1 , var_1 + 1 ) :
          for var_7 in range ( 1 , var_2 + 1 ) :
              if var_0 [ var_6 - 1 ] [ var_7 - 1 ] == '1' :
                  var_5 [ var_6 ] [ var_7 ] = min ( var_5 [ var_6 ] [ var_7 - 1 ] , var_5 [ var_6 - 1 ] [ var_7 ] , var_5 [ var_6 - 1 ] [ var_7 - 1 ] ) + 1
                  var_3 = max ( var_3 , var_5 [ var_6 ] [ var_7 ] )
      return var_3 * var_3
  