## Modify array to maximize sum of adjacent differences

Given an array, we need to modify values of this array in such a way that sum of absolute differences between two consecutive elements is… Read More »

Given an array, we need to modify values of this array in such a way that sum of absolute differences between two consecutive elements is… Read More »

Given a length n, count the number of strings of length n that can be made using ‘a’, ‘b’ and ‘c’ with at-most one ‘b’… Read More »

Consider a highway of M miles. The task is to place billboards on the highway such that revenue is maximized. The possible sites for billboards… Read More »

Given a gold mine of n*m dimensions. Each field in this mine contains a positive integer which is the amount of gold in tons. Initially… Read More »

Given a N x N matrix, determine the maximum K such that K x K is a submatrix with all equal elements i.e., all the… Read More »

Given a string consisting of digits 0-9, count the number of subsequences in it divisible by m. Examples: Input : str = “1234”, n =… Read More »

Given a N X N matrix Mat[N][N] of positive integers. There are only three possible moves from a cell (i, j) (i+1, j) (i+1, j-1)… Read More »

Given an array arr[0..n-1] of positive element. The task is to print remaining elements of arr[] after repeated deletion of LIS (of size greater than… Read More »

Given N number of coins, the task is to find probability of getting at least K number of heads after tossing all the N coins… Read More »

Given two integers n and k, count the number of binary strings of length n with k as number of times adjacent 1’s appear. Examples:… Read More »

There are n people and two identical voting machines. We are also given an array a[] of size n such that a[i] stores time required… Read More »

Given n friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find… Read More »

Given a 3-D array arr[l][m][n], the task is to find the minimum path sum from the first cell of array to the last cell of… Read More »

Prerequisite : Dynamic Programming | Set 8 (Matrix Chain Multiplication) Given a sequence of matrices, find the most efficient way to multiply these matrices together.… Read More »

We have given numbers in form of triangle, by starting at the top of the triangle and moving to adjacent numbers on the row below,… Read More »