Example 1
Example 2
1 <= kingName.length, parentName.length, childName.length, name.length <= 15kingName, parentName, childName, and name consist of lowercase English letters only.All arguments childName and kingName are distinct.All name arguments of death will be passed to either the constructor or as childName to birth first.For each call to birth(parentName, childName), it is guaranteed that parentName is alive.At most 105 calls will be made to birth and death.At most 10 calls will be made to getInheritanceOrder.Example 1
Example 2
1 <= kingName.length, parentName.length, childName.length, name.length <= 15kingName, parentName, childName, and name consist of lowercase English letters only.All arguments childName and kingName are distinct.All name arguments of death will be passed to either the constructor or as childName to birth first.For each call to birth(parentName, childName), it is guaranteed that parentName is alive.At most 105 calls will be made to birth and death.At most 10 calls will be made to getInheritanceOrder.