Earliest time everyone is connected
A time-sorted log has lines such as t3 Bob shared-ride-with Charlie. Sharing a ride connects two riders, and connection carries through other riders.
Given the log and the list of all riders, return the earliest timestamp at which every rider is connected, or report that it never happens. Follow-ups asked about logs in more than one format and the time complexity.
No answer yet. Write the first one; the best answer gets endorsed.

