You are given an integer n representing the number of nodes in a connected undirected graph, with nodes labeled from n edges, where edges[i]
You must assign each node a distinct integer from n. The value of an edge is the product of the values assigned to its endpoints.
Return the maximum possible sum of all edge values across the entire graph.
Constraints:
n
m edges.length
m n
edges[i].length
n
There are no repeated edges.
The graph is connected.
Each node is connected to at most
You are given an integer n representing the number of nodes in a connected undirected graph, with nodes labeled from n edges, where edges[i]
You must assign each node a distinct integer from n. The value of an edge is the product of the values assigned to its endpoints.
Return the maximum possible sum of all edge values across the entire graph.
Constraints:
n
m edges.length
m n
edges[i].length
n
There are no repeated edges.
The graph is connected.
Each node is connected to at most