Premium Content
Sign in to see the full question
Get access to the full problem, solutions, follow-up questions, and discussion.
Get access to the full problem, solutions, follow-up questions, and discussion.
You are given n connected components ("groups") of nodes. For example:
groups = [[1], [2, 3], [4, 5, 6]]
Each group is already internally connected. Your job is to write a function that...