Minimum Cost Tree From Leaf Values at MathWorks
Medium67.8% acceptance
This problem has 87.5% frequency at MathWorks.
Problem Description
Given an array `arr` of positive integers, consider all binary trees such that: * Each node has either `0` or `2` children; * The values of `arr` correspond to the values of each **leaf** in an in-order traversal of the tree. * The value of each non-leaf node is equal to the product of the la...
Read full problem and hintsTopics
Also asked at 3 companies
More MathWorks Questions
Maximum Number of AlloysMediumReshape the MatrixEasyMaximum Palindromes After OperationsMediumTotal Cost to Hire K WorkersMediumSell Diminishing-Valued Colored BallsMedium
View all MathWorks questions