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 hints

Topics

Also asked at 3 companies


More MathWorks Questions

View all MathWorks questions