comefrom: <doocs>2371.Minimize Maximum Value in a Grid_1.py
code: def minScore( grid: List[List[int]]) -> List[List[int]]:
      m, n = len(grid), len(grid[0])
      nums = [(v, i, j) for i, row in enumerate(grid) for j, v in enumerate(row)]
      nums.sort()
      row_max = [0] * m
      col_max = [0] * n
      ans = [[0] * n for _ in range(m)]
      for _, i, j in nums:
          ans[i][j] = max(row_max[i], col_max[j]) + 1
          row_max[i] = col_max[j] = ans[i][j]
      return ans
masked: def sample_funcname ( var_0 : List [ List [ int ] ] ) -> List [ List [ int ] ] :
      var_1 , var_2 = len ( var_0 ) , len ( var_0 [ 0 ] )
      var_7 = [ ( var_3 , var_4 , var_5 ) for var_4 , var_6 in enumerate ( var_0 ) for var_5 , var_3 in enumerate ( var_6 ) ]
      var_7.sort ( )
      var_8 = [ 0 ] * var_1
      var_9 = [ 0 ] * var_2
      var_11 = [ [ 0 ] * var_2 for var_10 in range ( var_1 ) ]
      for var_10 , var_4 , var_5 in var_7 :
          var_11 [ var_4 ] [ var_5 ] = max ( var_8 [ var_4 ] , var_9 [ var_5 ] ) + 1
          var_8 [ var_4 ] = var_9 [ var_5 ] = var_11 [ var_4 ] [ var_5 ]
      return var_11
  