Search
⌘K

Leetcode 2003. Smallest Missing Genetic Value in Each Subtree

Given a rooted tree where each node has a distinct genetic value (1..1e5), compute for every node the smallest positive integer (mex) that is missing from that node's subtree. The challenge is to produce these subtree mex values efficiently for up to 1e5 nodes/values.


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.