comefrom: <doocs>2373.Largest Local Values in a Matrix_1.py
code: def largestLocal( grid: List[List[int]]) -> List[List[int]]:
      n = len(grid)
      ans = [[0] * (n - 2) for _ in range(n - 2)]
      for i in range(n - 2):
          for j in range(n - 2):
              ans[i][j] = max(
                  grid[x][y] for x in range(i, i + 3) for y in range(j, j + 3)
              )
      return ans
masked: def sample_funcname ( var_0 : List [ List [ int ] ] ) -> List [ List [ int ] ] :
      var_1 = len ( var_0 )
      var_3 = [ [ 0 ] * ( var_1 - 2 ) for var_2 in range ( var_1 - 2 ) ]
      for var_4 in range ( var_1 - 2 ) :
          for var_5 in range ( var_1 - 2 ) :
              var_3 [ var_4 ] [ var_5 ] = max ( var_0 [ var_7 ] [ var_6 ] for var_7 in range ( var_4 , var_4 + 3 ) for var_6 in range ( var_5 , var_5 + 3 ) )
      return var_3
  