Available question text
Given two trees, for each node i in the first tree, choose one node in the second tree to connect with a single edge so as to maximize the number of nodes at even distance (including itself) from i in the resulting graph. Key observation: distances depend only on parity, so the problem reduces to 2-coloring each tree and summing the size of i's parity class in tree1 with the larger parity-class size from tree2.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 3373. Maximize the Number of Target Nodes After Connecting Trees II
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source