my code is giving runtime error, please review my code :- https://ide.codingblocks.com/s/268943
Run Time Error On Submit
Your approach is wrong. First of all don’t take unsigned long long.
And the graph is a bidirectional road.
You have to count the size of each component which I dont see in your code.
To help you out I am sending you my code to you as a reference because I dont feel this is a question to spend days to debug this problem.