# Category Archives: Dynamic Programming

Given the number N, the task is to count a number of ways to create a number with digit size N with the sum ofâ€¦ Read More
Given a number N and string S, count the number of ways to create a binary string (containing only ‘0’ and ‘1’) of size Nâ€¦ Read More
Given two arrays a[] and b[][2] with both having size N. N operations have to be performed, and initially counter will be 0. Additionally, thereâ€¦ Read More
Given an array arr[] containing N elements, each element is between 0 to 9. The task is to count the number of ways modulo 109â€¦ Read More
Given an array A[] of size N (where N is even), Local maxima are array elements strictly greater in value than its adjacent elements i.e.,â€¦ Read More
Given two arrays A[] and B[] both of size N, the task is to count the number of non-decreasing arrays C[] of size N suchâ€¦ Read More
Given array A[] and B[] both having size N. Select minimum number indexes so that sum of elements from A[] on those indexes and theâ€¦ Read More
Given array A[] and B[] of size N representing N type of operations. Given a number H, reduce this number to less than equal toâ€¦ Read More
Given an array arr[][] of size N*3 where ith element represents that at time arr[i][0] secs, arr[i][2] coins appear at coordinate arr[i][1]. A player startsâ€¦ Read More
Given the number N, count the number of ways to create a binary string (the string that contains characters as zero or one) of sizeâ€¦ Read More
Given an array arr[] of size N, the task is to find the maximum sum of a subset of the array such that the sumâ€¦ Read More
Given a tree with N node and N-1 edges and an array arr[] where arr[i] denotes the value of ith node, the task is to findâ€¦ Read More
Jon and Arya are playing a game. The rules of the game are as follows: They have a single number N initially. Both will playâ€¦ Read More
Given two integer arrays A[] and B[] of length N and M respectively, the task is to find the minimum number of operations required suchâ€¦ Read More
Given a string S and a positive integer K, The task is to maximize the product of the length of non-overlapping palindromic substrings each ofâ€¦ Read More