Available question text
Count how many pairs of distinct leaf nodes in a binary tree have a shortest-path length less than or equal to a given distance. The challenge is to efficiently aggregate leaf-to-node distance information during a tree traversal (distance ≤ 10 bounds how far counts must be propagated) so you can count qualifying pairs without checking all leaf pairs.
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
LinkedIn
Leetcode 1530. Number of Good Leaf Nodes Pairs
Reported Feb 26, 2025 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source