← Questions

Earliest time everyone is connected

0
UberGoogleCodingLast asked Sep 2026

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.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding