Skip to content

Category Archives: Dynamic Programming

Given an array arr[] consisting of N characters, the task is to generate all possible combinations of at most X elements ( 1 ≤ X… Read More
Given an array of integers A[] consisting of N integers, find the number of triples of indices (i, j, k) such that A[i] & A[j]… Read More
Given an array arr[] of size N, the task is to find the count of all subsets from the given array whose product of is… Read More
Given an integer N, the task is to count the number of N-length strings consisting of lowercase vowels that can be generated based the following… 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 a matrix, mat[][] of size N * M, the task is to find the minimum count of operations required to make all elements of… Read More
Given an array arr[] consisting of N integers​​​, the task is to find the minimum number of array elements required to be removed to make… Read More
Given an integer N, the task is to tile a board of dimensions N * 1 the task is to count the number of ways… Read More
Given an N-ary Tree consisting of N nodes valued from 1 to N, an array arr[] consisting of N positive integers, where arr[i] is the… Read More
Given an array arr[] consisting of N integers, the task is to find the minimum cost to remove all elements from the array such that… Read More
Given three positive integers L, R and Y, the task is to count the numbers in the range [L, R] whose sum of digits is… Read More
Given an array arr[] consisting of N positive integers, the task is to find the length of the longest increasing subsequence possible by selecting elements… Read More
Given an array arr[] of size N, the task is to find the minimum number of array elements required to be removed from the array… Read More
Given an array arr[] consisting of N positive integers, the task is to minimize the remaining array element that can be obtained by repeatedly removing… Read More