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.

Photo by freddie marriage

Problem #1: Given a list of integers depicting the costs and an integer K. We are currently at the first index and want to reach the last index. The cost of using index “i” is it’s respective cost and in each move we can either jump [1…K] indices at once. Return the minimum cost to reach the last index.

Photo by Bram Naus

Problem #1: Given an N * M integers matrix, return the length of the longest increasing path in the matrix. It is allowed to move left, right, up or down from a cell but we may not move diagonally or outside the bounds of the matrix.

Photo by Nicolas HIPPERT

Problem : Given N, K and an array of integers of length N, we need to count all the subsequences such that, in those subsequences all the integers between 1 to K appear at least once.

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