Photo by Robert Lukeman

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.

Photo by Sascha Bosshard

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

Photo by Ged Lawson

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.

Photo by Zane Lee

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.

Photo by Gautam Arora

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.

Photo by Jaromír Kavan

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.

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.

Photo by Sergi Kabrera

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

Photo by Markus Winkler

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.

Photo by Surface

Problem #1: Given a binary tree, return the largest sum of any simple path between any two nodes.

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