## Check if any valid sequence is divisible by M

Given an array of N integers, using ‘+’ and ‘-‘ between the elements check if there is a way to form a sequence of numbers… Read More »

Given an array of N integers, using ‘+’ and ‘-‘ between the elements check if there is a way to form a sequence of numbers… Read More »

Given a tree with N nodes and N-1 edges, find out the maximum height of tree when any node in the tree is considered as… Read More »

In mathematics, the Golomb sequence is a non-decreasing integer sequence where n-th term is equal to number of times n appears in the sequence. The… Read More »

Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack.… Read More »

Given two numbers, n >= 0 and 0 <= k <= n, count the number of derangements with k fixed points. Examples: Input : n… Read More »

Dynamic Programming(DP) is a technique to solve problems by breaking them down into overlapping sub-problems which follows the optimal substructure. There are various problems using… Read More »

Given N integers and K, find the minimum number of elements that should be removed such that Amax-Amin<=K. After removal of elements, Amax and Amin… Read More »

Given a positive integer N, find the maximum number of segments of lengths a, b and c that can be formed from N . Examples… Read More »

Given an array A[] of n integers, find out the number of ordered pairs such that Ai&Aj is zero, where 0<=(i,j)<n. Consider (i, j) and… Read More »

Given an array of N numbers, we need to maximize the sum of selected numbers. At each step you need to select a number Ai,… Read More »

Given N, we have to find the sum of products of all combination taken 1 to N at a time. In simple words, we have… Read More »

Newman-Conway numbers is the one which generates the following integer sequence. 1 1 2 2 3 4 4 4 5 6 7 7….. and follows… Read More »

Given n integers. The task is to minimize the sum of multiplication of all the numbers by taking two adjacent numbers at a time and… Read More »

Given a number n then print n terms of fibonacci series in reverse order. Examples: Input : n = 5 Output : 3 2 1… Read More »

Given two strings s1, s2 and K, find the length of the longest subsequence formed by consecutive segments of at least length K. Examples: Input… Read More »