Get Connected Components Of A Graph
easy
1. You are given a graph. 2. You are required to find and print all connected components of the graph.
Constraints
None
Format
Input
Input has been managed for you
Output
Check the sample output
Example
Sample Input
7
5
0 1 10
2 3 10
4 5 10
5 6 10
4 6 10
Sample Output
[[0, 1], [2, 3], [4, 5, 6]]
Question Video