# Category Archives: Dynamic Programming

Given arrays A[] and B[] of size N and integer M, the task is to find out the minimum operations required to collect a sumâ€¦ Read More
Given non-negative integers X, Y, and Z for each M query. Given X amount of character ‘A’, Y amount of character ‘B’, and Z amountâ€¦ Read More
Given integers, L and R, the task is to find the âˆ‘f(x) for all L to R, where f(x) is defined for number as f(x)â€¦ Read More
Given integers L and R, the task is to find the number of integers in the range L to R whose bitwise OR of digitsâ€¦ Read More
Given an array arr[] of size N, with values either 1, 2, or 3. Traverse the array from left to right and before traversal predictâ€¦ Read More
Given a matrix A[][] of size N * N, where each matrix element is either -1 or 1. One can move from (X, Y) toâ€¦ Read More
Given an array of characters arr[] of size N, whose each character is either ‘&’ (Bitwise AND) or ‘|’ (Bitwise OR). there are many possibleâ€¦ Read More
Given two arrays arr1[] and arr2[] of size N each. Given target sum M, Choose either a[i] or b[i] for each i where (0 â‰¤â€¦ Read More
Given a positive integer N, the task is to find the value of F2 + F4 + F6 +………+ F2n upto N terms where Fiâ€¦ Read More
The Fibonacci numbers are the numbers in the following integer sequence.0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …….. Inâ€¦ Read More
Given two arrays arr1[] and arr2[] each of size N, the task is to create another array of size N from these two arrays byâ€¦ Read More
What is Knapsack Problem? Suppose you have been given a knapsack or bag with a limited weight capacity, and each item has some weight andâ€¦ Read More
Given an array arr[] of size N describing N moves. A player standing at origin (0, 0). In the first move, the player can moveâ€¦ Read More
Given an array A[] with size N, Select a subsequence B = {B[1], B[2], B[3], ………B[N] } of size M from given array A[]  (Nâ€¦ Read More
Given integers, N, L, and R, the task is to find the number of integers in the range L to R that does not containâ€¦ Read More