# Tag Archives: subsequence

## Lexicographically largest subsequence such that every character occurs at least k timesOctober 14, 2017

Given a string S and an integer K. The task is to find lexicographically largest subsequence of S, say T, such that every character in… Read More »

## Count all subsequences having product less than KOctober 5, 2017

Given a non negative array, find the number of subsequences having product smaller than K. Examples: Input : [1, 2, 3, 4] k = 10… Read More »

## Non-decreasing subsequence of size k with minimum sumJuly 5, 2017

Given a sequence of n integers, you have to find out the non-decreasing subsequence of length k with minimum sum. If no sequence exists output… Read More »

## Given a number as a string, find the number of contiguous subsequences which recursively add up to 9 | Set 2July 4, 2017

Given a number as a string, write a function to find the number of substrings (or contiguous subsequences) of the given string which recursively add… Read More »

## Maximum product of subsequence of size k

Given an array A[] of n integers, the task is to find a subsequence of size k whose product is maximum among all possible k… Read More »

## Maximum length prefix of one string that occurs as subsequence in anotherMay 11, 2017

Given two strings s and t. The task is to find maximum length of some prefix of the string S which occur in string t… Read More »

## Subsequence with maximum odd sumApril 22, 2017

Given a set of integers, check whether there is a subsequence with odd sum and if yes, then finding the maximum odd sum. If no… Read More »

## Number of subsequences of the form a^i b^j c^kMarch 27, 2017

Given a string, count number of subsequences of the form aibjck, i.e., it consists of i ’a’ characters, followed by j ’b’ characters, followed by… Read More »

## Find largest word in dictionary by deleting some characters of given stringMarch 17, 2017

Giving a dictionary and a string ‘str’, find the longest string in dictionary which can be formed by deleting some characters of the given ‘str’.… Read More »

## Find sum of sum of all sub-sequencesMarch 2, 2017

Given an array of n integers. The task is to find the sum of sum of each of sub-sequence of the array. Examples: Input :… Read More »

## Number of subsequences in a string divisible by nFebruary 27, 2017

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 »

## Queries on subsequence of stringJanuary 24, 2017

Given a string S and Q queries, each query contains a string T. The task is print “Yes” if T is subsequence of S, else… Read More »

## Minimum number of elements which are not part of Increasing or decreasing subsequence in arrayJanuary 19, 2017

Given an array of n elements. Make strictly increasing and strictly decreasing subsequences from the array such that each array element belongs to increasing subsequence… Read More »

## Find all distinct subset (or subsequence) sums of an arrayJanuary 10, 2017

Given a set of integers, find distinct sum that can be generated from the subsets of the given sets and print them in an increasing… Read More »

## Maximum sum Bi-tonic Sub-sequenceJanuary 6, 2017

Given an array of integers. A subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Examples: Input : arr[] = {1,… Read More »