Search
⌘K

Leetcode 1600. Throne Inheritance

Maintain an evolving rooted family tree (king as root) that supports adding a child and marking a person dead, and return the current inheritance order defined by a preorder (DFS) traversal that lists each person before their children in birth order, skipping deceased members. The core challenge is efficiently handling online updates and queries where the inheritance order follows this fixed traversal rule.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.