Skip to content

Category Archives: Dynamic Programming

Given a string S, the task is to find the length of the longest increasing subsequence present in the given string. A sequence of characters… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the minimum difference between the sum… Read More
Given an array arr[] consisting of N integers, the task is to find the size of the set S such that Bitwise XOR of any… Read More
Given an integer N, the task is to paint a grid of size N x 3 using colors Red, Yellow, or Green while making such… Read More
Given two strings str and X of length N and M respectively, the task is to find the minimum characters required to be removed from… Read More
Given four integers A, B, C and N, where A, B, C represents the first three numbers of the geekonacci series, the task is to… Read More
Given an integer N, representing the number of stations lying between the source and the destination. There are three trains available from every station and… Read More
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to maximize the GCD of the array arr[]… Read More
Given a matrix mat[][] of dimensions N * M, and an integer K, the task is to find the maximum sum of any rectangle possible… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to print the maximum sum possible in a subsequence satisfying… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum cost required to either cross the array or reach… Read More
Given a positive integer N, the task is to find the number of binary strings of length N which contains “11” as a substring. Examples:… Read More
Given an array arr[] consisting of N positive integers and an integer K, the task is to find the maximum sum of array elements possible… Read More
Prerequisite: Kadane’s algorithm Given a 2D array arr[][] of dimension N*M, the task is to find the maximum sum sub-matrix from the matrix arr[][]. Examples:… Read More