Company: Titan_27sep
Difficulty: medium
Code Mania Problem Description "Code Mania" is a very famous coding challenge. Radha is responsible for sending our country's team to this contest. She is planning to send 2 people to the contest, and she wants them to be from different states of our country. She has a list of p pairs of programmer ids. Each pair names two programmers who are from the same state. Being from the same state carries over along the list: if programmers with id 1 and id 2 are from the same state, and programmers with id 1 and id 5 are from the same state, then programmers with id 2 and id 5 are also from the same state. There are N programmers, with ids 1 to N . Determine how many pairs of programmers from different states Radha can choose. Function Description Complete the function numberOfWays in the editor. It has the following parameters: int n : the number of programmers N (ids are 1 to N ) int p : the number of listed pairs programmers : a list of p pairs [a, b] ; programmers a and b are from the same