Amazon Interview Question

Leetcode 323 Number of connected components in an Undirected Graph