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:
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected