Search
⌘K

Leetcode 3600. Maximize Spanning Tree Stability with Upgrades

Find a spanning tree that maximizes the minimum edge strength (stability) when some edges are mandatory (must be included and cannot be upgraded) and up to k optional edges can be doubled once. This is a parametric search problem — binary-search the target stability and use greedy/DSU feasibility checks to see if required edges plus optional edges that already meet or can be upgraded to meet the target (within k upgrades) can connect all nodes; return -1 if impossible.


Question Timeline

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

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