Photo by Chris J. Davis

Problem: Given a list of integers, arr. Consider a tree where arr represents the values of its leaves in an inorder traversal. All internal nodes have 2 children each and their value is equal to the product of the largest leaf value of its left subtree and the largest leaf value of its right subtree. Find the tree with the minimum sum of its values and return the sum.

Let us consider the following example to get a clearer idea of this problem,

Photo by Markus Winkler

In our previous blog, we already started with the introduction to one of the problems that we are going to discuss. We will try to discuss further about the topics involved.

Let us revisit the problem statement,

Problem #1: Given two strings A and B, find the minimum edit distance between the two strings. Edit distance is defined using: (a) Deleting a character, (b) Inserting a character, (c) Replacing a character.

Let us consider the following example to get a clearer idea of this…

Ankesh Krishna Prasad

Sport Programmer | Software Development Enthusiast | Problem Solver | Philonoist

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store