# Category Archives: Dynamic Programming

Given two strings text and pattern of length M and N respectively, The task is to check if the pattern matches the text or not.â€¦ Read More
Given two positive integers N and S, the task is to count the number of unique outcomes possible when S flip operations are performed onâ€¦ Read More
Given a binary matrix mat[][] that represents the adjacency matrix representation of a graph, where mat[i][j] as 1 represents that there is an edge betweenâ€¦ Read More
Given an integer N representing the number of red and blue candies and a matrix mat[][] of size N * N, where mat[i][j] = 1â€¦ Read More
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 integers and an integer K, the task is to find the sum of the length of the twoâ€¦ 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