##
Sum of average of all subsets
December 14, 2016

Given an array arr of N integer elements, the task is to find sum of average of all subsets of this array. Input : arr[]… Read More »

December 14, 2016

Given an array arr of N integer elements, the task is to find sum of average of all subsets of this array. Input : arr[]… Read More »

December 13, 2016

Given a string, the task is to count all palindrome substring in a given string. Length of palindrome substring is greater then or equal to… Read More »

December 12, 2016

Given a sequence of positive numbers, find the maximum sum that can be formed which has no three consecutive elements present. Examples: Input: arr[] =… Read More »

December 8, 2016

Given an array, the task is to find sum of maximum sum alternating subsequence starting with first element. Here alternating sequence means first decreasing, then… Read More »

November 21, 2016

Given an array of integers and a number k. We can pair two number of array if difference between them is strictly less than k.… Read More »

November 17, 2016

Given a square matrix of size N*N, where each cell is associated with a specific cost. A path is defined as a specific sequence of… Read More »

November 16, 2016

Given a number n, we can divide it in only three parts n/2, n/3 and n/4 (we will consider only integer part). The task is… Read More »

November 14, 2016

Find how many palindromic subsequence (need not necessarily be distinct) can be formed in a given string. Note that the empty string is not considered… Read More »

November 13, 2016

You are given two strings.Now you have to print all longest common sub-sequences in lexicographical order? Examples: Input : str1 = “abcabcaa”, str2 = “acbacba”… Read More »

Given a matrix of integers where every element represents weight of the cell. Find the path having the maximum weight in matrix [N X N].… Read More »

November 10, 2016

Given an array, an inversion is defined as a pair a[i], a[j] such that a[i] > a[j] and i < j. We are given two… Read More »

November 7, 2016

Consider a game, in which you have two types of powers, A and B and there are 3 types of Areas X, Y and Z.… Read More »

October 14, 2016

Given a string that represents an expression constituting numbers and binary operator +, – and * only. We need to parenthesize the expression in all… Read More »

October 7, 2016

We are given an array of digits (values lie in range from 0 to 9). The task is to count all the sub sequences possible… Read More »

October 3, 2016

Given a two strings S and T, find count of distinct occurrences of T in S as a subsequence. Examples: Input : S = banana,… Read More »