## Maximum average sum partition of an array

Given an array, we partition a row of numbers A into at most K adjacent (non-empty) groups, then the score is the sum of the… Read More »

## Maximum sum increasing subsequence from a prefix and a given element after prefix is must

Given an array of n positive integers, write a program to find the maximum sum of increasing subsequence from prefix till i-th index and also… Read More »

## Find maximum sum array of length less than or equal to m

Given n arrays of different length consisting of integers, the target is to pick atmost one subarray from an array such that the combined length… Read More »

## Prefix Sum of Matrix (Or 2D Array)

Given a matrix (or 2D array) a[][] of integers, find prefix sum matrix for it. Let prefix sum matrix be psa[][]. The value of psa[i][j]… Read More »

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

## Maximize array elements upto given number

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 »

## Multistage Graph (Shortest Path)

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 »

## Moser-de Bruijn Sequence

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 »

## Longest Common Substring (Space optimized DP solution)

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

## Maximum Subarray Sum Excluding Certain Elements

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 »

## Minimum Sum Path in a Triangle

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 »

## Size of The Subarray With Maximum Sum

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

## Minimal moves to form a string by adding characters or appending string itself

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 »

## Maximum Product Subarray | Added negative product case

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 »

## Print equal sum sets of array (Partition problem) | Set 1

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 »