Company: Boeing Swe on campus_16march
Difficulty: medium
Debugging - Count Network Component Groups You have a buggy implementation for the following problem in the countConnectedComponents function. The current solution does not work correctly because there are errors in the code. Your job is to identify and correct all errors to make it pass all test cases Statement You are given an undirected network made of N points and M links between them. Work out how many separate groups the network splits into, where a group is any portion of the network within which every pair of points can reach each other by traveling along links. Function Description You need to implement the function countConnectedComponents . The function should take the number of points N and a list of links and return the number of separate groups in the network. Parameters: N: An integer showing the number of points in the network. M: An integer showing the number of links. edges: A list of M pairs, where each pair (u, v) shows a link between point u and point v . The netwo