Auntie Loop is organizing a neighborhood potluck. Friendships connect homes; count the number of separate invitation circles. Input: n m and m undirected friendship pairs (1-based). Output: number of connected groups.
Example 1:
Example 2:
Example 3:
Constraints:
1≤n≤200000; 0≤m≤300000.
Tags:
