comefrom: <doocs>0221.Maximal Square_1.py
code: def maximalSquare( matrix: List[List[str]]) -> int:
      m, n = len(matrix), len(matrix[0])
      dp = [[0] * (n + 1) for _ in range(m + 1)]
      mx = 0
      for i in range(m):
          for j in range(n):
              if matrix[i][j] == '1':
                  dp[i + 1][j + 1] = min(dp[i][j + 1], dp[i + 1][j], dp[i][j]) + 1
                  mx = max(mx, dp[i + 1][j + 1])
      return mx * mx
masked: def sample_funcname ( var_0 : List [ List [ str ] ] ) -> int :
      var_1 , var_2 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_4 = [ [ 0 ] * ( var_2 + 1 ) for var_3 in range ( var_1 + 1 ) ]
      var_5 = 0
      for var_6 in range ( var_1 ) :
          for var_7 in range ( var_2 ) :
              if var_0 [ var_6 ] [ var_7 ] == '1' :
                  var_4 [ var_6 + 1 ] [ var_7 + 1 ] = min ( var_4 [ var_6 ] [ var_7 + 1 ] , var_4 [ var_6 + 1 ] [ var_7 ] , var_4 [ var_6 ] [ var_7 ] ) + 1
                  var_5 = max ( var_5 , var_4 [ var_6 + 1 ] [ var_7 + 1 ] )
      return var_5 * var_5
  