Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Leetcode 1101. The Earliest Moment When Everyone Become Friends
Given timestamped friendship events among N people, determine the earliest time when the social graph becomes fully connected; process events in chronological order and use a union-find (DSU) to merge components, returning the timestamp when the component count becomes one or -1 if it never does.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late September, 2024
Mid-level
The Earliest Moment When Everyone Become Friends
Late September, 2024
Mid-level
Find the earliest timestamp when all become friends with add and remove friend operations. Two types of logs: Add Friend (A and B become friends) and Remove Friend (If A and B are friends, unfriend them). Two people can be connected and disconnected multiple times.
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.