LeetCode 685. Redundant Connection II

3 invalid situations case1: 2 parents no circle case2: 2 parents with circle case3: 1 parent with circle   2 main steps 1 check whether there exists a node with 2 parents, if yes, store the two edges.
相关文章
相关标签/搜索