Karat Online Interview
Anonymous User
5266

All nodes have 0, 1, or multiple parent given the realitionship in pairs ((0,1),(1,2),(1,4)).
For example, (0,1) -> 0 is a parent of 1.

Find the node has no parent or exactly 1 parent.
Given two nodes decide do they have a common ancestor ?

Comments (5)