Strange BST
There are $N$ nodes where the $i^{th}$ node has the following values associated to it: - Weight: Each node has a **distinct** weight $W_i$. The value $W_i$ is given in the input. - Support: Each node has a support value $S_i$. The value $S_i$ is given in the input. - Key: The key for the $i^{th}$ node is defined as $K_i = S_i + \Sigma W_j$, where the $j^{th}$ node is a descendant node of the $i^{
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start