# Problem : Given a list of lists of integers, return the smallest difference that can be made by choosing exactly one integer from each of the lists and taking the difference between the maximum and the minimum number of the chosen integers.

Let us consider an example to understand the problem better,

# Problem : Given two strings S and T. Consider taking a non-empty subsequence from S, a non-empty subsequence from T, and then concatenating the first subsequence with the second. Return the longest possible palindrome that can be constructed.

Let us consider an example to understand what we are required to do.

# Problem : Given a binary tree root, return the top view of the tree, sorted left to right.

Let us consider an example to understand what we are required to do.

# Approaches To Problem Solving #18 (BFS | 2-D Matrix)

## Problem: Given a 2-D list of integers containing 1s and 0s. Return a 2-D matrix representing the Manhattan distance of the current cell from the nearest 0 cell. It can be assumed that at least one 0 exists in the matrix.

Let us consider an example to understand what we are required to do.

# Problem: Given a binary tree, return the longest path that alternates, going down from one child to the other child. For example, it may alternate between right child, left child, right child, etc. Or left child, right child, left child, etc, going down.

Let us consider an example to understand the problem better,

# Problem: Given the strings “A” and “B” consisting of lowercase alphabet characters, return the number of subsequences of “A” that are equal to “B”. Mod the result by 10**9 + 7.

Let us consider an example to understand the problem better,

# Problem : You are given N cities represented as integers and a list of one-way roads that connects one city to another. Return whether you can reach one city from any city.

Let us consider an example to understand the problem better,

# 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,

# Problem : Given a two-dimensional matrix of integers containing 1s and 0s, return the total number of square submatrices with all 1s.

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

# Approaches To Problem Solving #12(String | DP)

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…