Max LCA Sum
MoEngage has given you two trees $T_1$ and $T_2$. Both trees have $N$ nodes and are rooted at node $1$. Definitions: - $LCA_1(u,v) = $ [Lowest common ancestor](https://en.wikipedia.org/wiki/Lowest_common_ancestor) of node $u$ and node $v$ in tree $T_1$. - $LCA_2(u,v) = $ Lowest common ancestor of node $u$ and node $v$ in tree $T_2$. - $H_1(v) = $ Number of nodes in the shortest path from node $
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