Leetcode 2792. Count Nodes That Are Great Enough
Given a rooted tree of integer values, count the nodes that are "great enough" — typically meaning each node's value is at least the maximum value among its ancestors on the root-to-node path. The hard version adds large constraints and/or updates/queries, forcing you to combine tree traversal/rerooting ideas with efficient data structures (Euler tour/HLD + segment tree or similar) to maintain path maxima and counts quickly.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.