AKUNA CAPITAL Interview Question

Connected Computers. We can use union find to do the problem