kamyu104/LeetCode-Solutions

The Python solution of 685 Redundant Connection II might need to be improved.

sangheestyle opened this issue · 4 comments

Hi,

It seems that the Python solution of 685 Redundant Connection II might need to be improved because it doesn't work.

I wanted to contribute to the solution but I am still trying to solve the problem. :0

Thanks for notification. This has been fixed :).

@kamyu104 Awesome. I checked the solution and easy to expand from your UnionFind solutions.

Additionally, can I ask you a question?

Could you tell me the reason why we need y != y_root? Without it, it looks fine but I am wondering.

After fixing it, we have skipped the edge which makes 2 parents. y != y_root is no longer required.

@kamyu104 I checked it. Thank you so much!