Return, for each query node, the number of other nodes reachable from it.
Unlock detailed company stats for this questionUpgrade
You are given a graph with possibly multiple disconnected components, and q queries, each containing a node. For each query, return the number of other nodes reachable from that node, which is the size of the node's connected component minus one.
Community answers
No answers contributed by the community yet.
Related questions
Given a DAG and two start nodes, find a node reachable from both with the same number of hops.Return the total number of shares held on each date.N people queue for seats: each takes the wanted seat if it is free, otherwise wants the next seat number and rejoins the back of the queue. Return everyone's final seat.Related courses

Course

Course
Course
