New
The Learning module is now live
See what's new
×
Question Bank
Learning
NEW
Pricing
Blog
Forum
HOT
JobRadar
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
TikTok
Coding Question
AI Insights
Quick Summary
Balance all root-to-leaf path latencies in a perfect binary tree by only increasing edge weights.
Minimize the total additional latency added across all edges to achieve uniform leaf depth.
The tree structure is implicitly defined using standard binary heap indexing rules.
What This Tests
Post-order tree traversal
Greedy subtree balancing
Recursive state accumulation
Implicit array-to-tree mapping
Common Patterns
DFS/BFS
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Accepted
2.3k
/4.2k
Acceptance Rate
53.4%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.7-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
n =
latency =
Output
Expected