Given a list of binary tree nodes, determine if list is valid
Anonymous User
191

I received this question as part of a tech phone screen from a FAANG company:

Given a list of binary tree nodes, return the root node if the list makes up a single, valid binary tree.

If there is more than one tree in the list, or there is a cycle, or a child node has more than one parent, etc. then return null.

Comments (1)