# Category Archives: Dynamic Programming

Given binary string str of size N, the task is to remove the minimum number of characters from the given binary string such that theâ€¦ Read More
Given a positive integer K and a matrix grid of dimensions N * M consisting of characters ‘.’ and ‘#’, where ‘.’ represents the unblockedâ€¦ Read More
Given two arrays arr1[] and arr2[] having N integers in non-decreasing order, the task is to find the count of non-decreasing arrays arr3[] of lengthâ€¦ Read More
Type I: At most one transaction is allowed Given an array prices[] of length N, representing the prices of the stocks on different days, theâ€¦ Read More
Given an array of integers arr[], find the subsequence with maximum sum whose elements are first decreasing, then increasing, or vice versa, The subsequence canâ€¦ Read More
Given an array arr[] of size N. The task is to find the maximum score that can be achieved by alternative minus – plus ofâ€¦ Read More
Given two integers N and K, the task is to find the count of sequences of K elements from the range [1, N] where everyâ€¦ Read More
Given an array arr[] of length N and an integer X, the task is to find the number of subsets with a sum equal toâ€¦ Read More
Given string str, the task is to find the minimum number of characters to be inserted to convert it to a palindrome. Before we goâ€¦ Read More
Given string str, the task is to find the minimum number of characters to be inserted to convert it to a palindrome. Before we goâ€¦ Read More
Given string str, the task is to find the minimum number of characters to be inserted to convert it to a palindrome. Before we goâ€¦ Read More
Given a positive number N, the task is to find the number of ways to reach N from 2 wherein each operation one of theâ€¦ Read More
Given an array arr[] consisting of values (0, 1, 2, 3) of length N, representing the type of work that can be done on anyâ€¦ Read More
Given a string S of size N and an array queries, containing Q queries in the form of L, R. The task is to findâ€¦ Read More
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.    Recommended: Pleaseâ€¦ Read More