Given a tree, prune it to select for only a certain node color

Given that a tree is made of only red or black nodes, return another tree that only has the paths of the original tree leading to a red node.

Problem Statement

Given that a tree is made of only red or black nodes, return another tree that only has the paths of the original tree leading to a red node.

References

Ankur from Google

Recommended reading

Author
Amin Ariana
Published
April 2011