Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1579. Remove Max Number of Edges to Keep Graph Fully Traversable
Given an undirected graph with edges usable by Alice-only, Bob-only, or both, compute the maximum number of edges you can remove while still allowing both Alice and Bob to traverse the entire graph (return -1 if impossible). This is a connectivity/union-find problem where you must optimally choose edges—typically by greedily using shared (type-3) edges first—to keep both users' graphs connected and count redundant edges.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.