Developing the test cases

abroads
disjoint-set
dsu
graph
sets
test-cases

#1

How to derive test cases for problems like this

Can anyone derive possible test cases for this problem, I am getting wrong answer for its solution, my code is working fine with all the test cases, which I have developed.


#2

This tool might come in handy.

You can generate random arrays,strings and even graphs there .

For questions like this you can generate the graphs randomly but I think since the queries are complex(two kinds of queries ) , you would need to generate those yourselves .