The Python solution of 685 Redundant Connection II might need to be improved.
sangheestyle opened this issue · 4 comments
sangheestyle commented
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
kamyu104 commented
Thanks for notification. This has been fixed :).
sangheestyle commented
@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.
kamyu104 commented
After fixing it, we have skipped the edge which makes 2 parents. y != y_root
is no longer required.
sangheestyle commented
@kamyu104 I checked it. Thank you so much!