NeetCode #162LC-1101MediumArrays & Hashing
← Back to All Problems

#162 · #1101 · The Earliest Moment When Everyone Become Friends(彼此熟识的最早时间)

📌 Problem Statement & Constraints

There are n people in a social network. Given logs where logs[i] = [timestamp, idA, idB] means the two people became friends at that time, return the earliest time at which all people are connected (or -1 if it never happens). Constraints: 1 <= n <= 1000, 1 <= logs.length <= 10^4; logs is not necessarily sorted.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!