How can Union Find solve this case [[3,1],[2,1]], even the OJ can not solve this. Or I misunderstood this problem set...

  • 0

    for test case like [[3,1],[2,1]], using union set, no edge will be removed. But obviously we should remove [2,1] to make it a tree.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.