NewThe Learning module is now liveSee what's new

You are given n people labeled from 0 to n - 1. Some pairs of people know each other directly. These relationships are given as a list connections, where each element [a, b] means person a and person b know each other.

The relationships satisfy the following conditions:

Test Cases
Input
Output
Expected