Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1530. Number of Good Leaf Nodes Pairs
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.
Asked at:
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Late February, 2025
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.