comefrom: <doocs>1605.Find Valid Matrix Given Row and Column Sums_1.py
code: def restoreMatrix( rowSum: List[int], colSum: List[int]) -> List[List[int]]:
      m, n = len(rowSum), len(colSum)
      ans = [[0] * n for _ in range(m)]
      for i in range(m):
          for j in range(n):
              x = min(rowSum[i], colSum[j])
              ans[i][j] = x
              rowSum[i] -= x
              colSum[j] -= x
      return ans
masked: def sample_funcname ( var_0 : List [ int ] , var_1 : List [ int ] ) -> List [ List [ int ] ] :
      var_2 , var_3 = len ( var_0 ) , len ( var_1 )
      var_5 = [ [ 0 ] * var_3 for var_4 in range ( var_2 ) ]
      for var_6 in range ( var_2 ) :
          for var_7 in range ( var_3 ) :
              var_8 = min ( var_0 [ var_6 ] , var_1 [ var_7 ] )
              var_5 [ var_6 ] [ var_7 ] = var_8
              var_0 [ var_6 ] -= var_8
              var_1 [ var_7 ] -= var_8
      return var_5
  