Minimum Cost Tree From Leaf Values
Medium
Interval DP
Given the in-order leaf values of a binary tree in which every non-leaf node has two children and its value is the product of the largest leaf in its left subtree and the largest leaf in its right subtree, print the minimum possible sum of all non-leaf node values.
Constraints
2 <= n <= 40 1 <= value <= 15
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.