# Tag Archives: Algorithms-Dynamic Programming

Given arrays A[] and B[] of size N, the task is to count ways to form an array of size N such that the newโฆ Read More
Dynamic Programming (DP) is defined as a technique that solves some particular type of problems in Polynomial Time. Dynamic Programming solutions are faster than theโฆ Read More
Given a complete graph having N nodes and N*(N-1)/2 edges and a positive integer K, the task is to find the number of ways ifโฆ Read More
Given an integer N and a 2D array cost[][3], where cost[i][0], cost[i][1], and cost[i][2] is the cost of painting ith house with colors red, blue,โฆ Read More
Given three integers N, A, and B, the task is to calculate the probability that the sum of numbers obtained on throwing the dice exactlyโฆ Read More
Given an array arr[] of size N and an integer K, the task is to find the maximum subarray sum by removing at most Kโฆ Read More
Given an array arr[] of N positive integers. The task is to find the length of the shortest sub-sequence such that the GCD of theโฆ Read More
Give an integer N, the task is to find the minimum number of moves to reduce N to 0 by one of the following operations:โฆ Read More
Given a string S, the task is to find the count of maximum occurring subsequence P from S using only those characters whose indexes areโฆ Read More
Given a number N, the task is to find the number of ways in which the integer N can be represented as a sum ofโฆ Read More
Given a string S of length N which only contains lowercase alphabets. Find the length of the longest substring of S such that the charactersโฆ Read More
Given a tree with N nodes value from 1 to N and (N – 1) Edges and a number K, the task is to removeโฆ Read More
Given N number of envelopes, as {W, H} pair, where W as the width and H as the height. One envelope can fit into anotherโฆ Read More
Given an array arr[], the task is to find the elements of a contiguous subarray of numbers that has the largest sum. Examples: Input: arrโฆ Read More
Given a matrix mat[][] with N rows and M columns. The task is to find the minimum number of changes required in the matrix suchโฆ Read More