Leetcode 2973. Find Number of Coins to Place in Tree Nodes
For each node in a rooted tree, compute coins = 1 if its subtree has fewer than 3 nodes, otherwise the maximum product of any three distinct costs in that node’s subtree (use 0 if every such product is negative). The core challenge is efficiently aggregating per-subtree extreme cost values to evaluate the best triple for every node.
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.