Amazon | Phone Screen | Add new connection
5215

Check if an N-ary tree is in valid state after adding a new connection.

boolean isValid(Node root, Node n1, Node n2);

Example:

Onsite experience

Comments (7)