Given an array arr[] of size N and an integer K, the task is to find the minimum cost required to reduce given array to… Read More

# Category Archives: Dynamic Programming

Given an array arr[] consisting of N integers, the task is to find the minimum number of array elements required to be removed to to… 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

Given a string str of length N, the task is to print all possible non-empty subsequences of the given string such that the subsequences either… Read More

Given an integer N, the task is to reduce the value of N to 0 by performing the following operations minimum number of times: Flip… Read More

Given a 2D array arr[][] of size N * M, and an integer K, the task is to select K elements with maximum possible sum… Read More

Given a string str of length N, the task is to print all possible distinct subsequences of the string str which consists of non-repeating characters… Read More

Given a sorted array arr[] of size N, the task is to check if it is possible to reach the end of the given array… Read More

Given an integer matrix mat[][] of dimensions N * M, the task is to print the maximum product of matrix elements in the path from… Read More