Problem
Given n nodes and a list of undirected edges, return the number of connected components in the graph.
References
Difficulty
🟡 Medium
Companies
Microsoft, Facebook, Morgan Stanley
Notes
Language: Java
Classic Union Find application. Also solvable with BFS/DFS counting components.
Problem
Given n nodes and a list of undirected edges, return the number of connected components in the graph.
References
Difficulty
🟡 Medium
Companies
Microsoft, Facebook, Morgan Stanley
Notes
Language: Java
Classic Union Find application. Also solvable with BFS/DFS counting components.