Company: uber_6oct
Difficulty: medium
Largest Partner Cluster Product Problem Description Uber Eats delivery partners are often linked to restaurants they frequently pick up from. Each restaurant hub is represented by an ID from 1 to 100 . If two delivery partners both pick up from the same restaurant, they are considered connected through that hub. Connections are transitive within a restaurant hub : if Partner A picks up from the same restaurant as Partner B, and Partner B picks up from the same restaurant as Partner C, then Partner A is also connected to Partner C through that restaurant. Connections through different hubs are never combined. You are given n connections. The i -th connection says that partners restaurantFrom[i] and restaurantTo[i] are connected through hub restaurantIds[i] . A connection has no direction: restaurantFrom[i] and restaurantTo[i] can be swapped without changing anything. (inferred -- the source treats a connection as a shared pick-up, which is symmetric.) For every hub, the connections that