#323

Number of Connected Components in an Undirected Graph

medium· Graphsruns: 0

You have an undirected graph of n nodes labeled 0 to n - 1. You are given the integer n and an array edges where each edges[i] = [a, b] indicates an undirected edge between a and b. Return the number of connected components in the graph.

sign in to paste and practice your own solution
desktop only

codedrill is a typing game and needs a real keyboard. open this on a laptop or desktop to practice.

you can still browse problems and sections from your phone.