Search
⌘K

Leetcode 2646. Minimize the Total Price of the Trips

Given a tree and many trips (each traversing any path between two nodes), you must minimize the total sum of node prices across all trips by halving the prices of a chosen set of non-adjacent nodes. Core challenge: compute how often each node is used across all trip paths, then run a tree DP over the independent-set constraint (pick/skip each node) to maximize savings and hence minimize total cost.


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.