solulubeta
Sign in
NeetCode 150 / Graphs
11.11 · Problem

Number of Connected Components in an Undirected Graph

Medium Union-Find counting merges 1 video LC 323 Pro

This problem is part of solulu Pro

There are n nodes labelled 0 to n − 1 and a list of undirected edges. Return the number of connected components.

Lifetime ₹1,999 ₹999 · Launch offer
Mark this problem as solved when you are finished.

Item 90 of 150 · updated 2026-10-12