Remove duplicate descendant targets For example, if the tree is like this: X -> A -> B -> C -> D X -> A -> E -> F -> G And the specified targets are [C, D, F, G] B, C, E, F are not needed. So the result is [D, G]
Remove duplicate descendant targets For example, if the tree is like this: X -> A -> B -> C -> D X -> A -> E -> F -> G And the specified targets are [C, D, F, G] B, C, E, F are not needed. So the result is [D, G]