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.
相關文章
相關標籤/搜索