You are given an integer n denoting the number of cities labeled from n roads where roads[i]
Assign each city an integer value from n such that each value is used exactly once. The importance of a road is defined as the sum of the values assigned to the two cities it connects.
Return the maximum possible total importance of all roads after assigning the values optimally.
Constraints:
n
roads.length
roads[i].length
n
There are no duplicate roads.
You are given an integer n denoting the number of cities labeled from n roads where roads[i]
Assign each city an integer value from n such that each value is used exactly once. The importance of a road is defined as the sum of the values assigned to the two cities it connects.
Return the maximum possible total importance of all roads after assigning the values optimally.
Constraints:
n
roads.length
roads[i].length
n
There are no duplicate roads.