comefrom: <doocs>2285.Maximum Total Importance of Roads_1.py
code: def maximumImportance( n: int, roads: List[List[int]]) -> int:
      deg = [0] * n
      for a, b in roads:
          deg[a] += 1
          deg[b] += 1
      deg.sort()
      return sum(i * v for i, v in enumerate(deg, 1))
masked: def sample_funcname ( var_0 : int , var_1 : List [ List [ int ] ] ) -> int :
      var_2 = [ 0 ] * var_0
      for var_3 , var_4 in var_1 :
          var_2 [ var_3 ] += 1
          var_2 [ var_4 ] += 1
      var_2.sort ( )
      return sum ( var_5 * var_6 for var_5 , var_6 in enumerate ( var_2 , 1 ) )
  