Earliest Time When Everyone Becomes Connected

Asked at Google · Coding Questions · Difficulty: Medium

A group of `n` people, numbered `0` to `n - 1`, starts out as strangers. Over time, pairs of people become acquainted. Two people are connected if they are acquainted directly or through a chain of acquaintances. Given the log of when each pair became acquainted, find the earliest moment at which the whole group is connected.

Loading the problem…