## Dynamic Programming | Wildcard Pattern Matching | Linear Time and Constant Space

Given a text and a wildcard pattern, find if wildcard pattern is matched with text. The matching should cover the entire text (not partial text).… Read More »

Given a text and a wildcard pattern, find if wildcard pattern is matched with text. The matching should cover the entire text (not partial text).… Read More »

Given an array of integers, a number and a maximum value, task is to compute the maximum value that can be obtained from the array… Read More »

A Multistage graph is a directed graph in which the nodes can be divided into a set of stages such that all edges are from… Read More »

Given an integer ‘n’, print the first ‘n’ terms of the Moser-de Bruijn Sequence. The Moser-de Bruijn sequence is the sequence obtained by adding up… Read More »

Given two strings ‘X’ and ‘Y’, find the length of longest common substring. Expected space complexity is linear. Examples: Input : X = “GeeksforGeeks”, Y… Read More »

Given an array of A of n integers and an array B of m integers find the Maximum Contiguous Subarray Sum of array A such… Read More »

Given a triangular structure of numbers, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the… Read More »

An array is given, find length of the subarray having maximum sum. Examples: Input : a[] = {1, -2, 1, 1, -2, 1} Output :… Read More »

Given a string S, we need to write a program to check if it is possible to construct the given string S by performing any… Read More »

Given an array that contains both positive and negative integers, find the product of the maximum product subarray. Expected Time complexity is O(n) and only… Read More »

Given an array arr[]. Determine whether it is possible to split the array into two sets such that the sum of elements in both the… Read More »

Given an integer n. we have to find the nth term of Stern’s Diatomic Series. Stern’s diatomic series is the sequence which generates the following… Read More »

Given an algebraic expression of the form (x1 + x2 + x3 + . . . + xn) * (y1 + y2 + . .… Read More »

Given an array of N integers, using ‘+’ and ‘-‘ between the elements check if there is a way to form a sequence of numbers… Read More »

Given a tree with N nodes and N-1 edges, find out the maximum height of tree when any node in the tree is considered as… Read More »