Search
⌘K

Leetcode 3547. Maximum Sum of Edge Values in a Graph

Given a connected undirected graph with max degree 2 (so it is a path or cycle), assign the unique labels 1..n to nodes to maximize the sum of products of values on each edge. The core challenge is to optimally permute labels along paths/cycles so that large numbers contribute to as many edge-products as possible.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.