Check if a string is present in the given Linked List as a subsequence
Given a string S of size N and a linked list, the task is to check if the linked list contains a string as a subsequence. Print Yes if it contains the subsequence otherwise print No....
read more
Count of subsequences of length 4 in form (x, x, x+1, x+1) | Set 2
Given a large number in form of string str of size N, the task is to count the subsequence of length 4 whose digit are in the form of (x, x, x+1, x+1).Example:...
read more
Maximum product of bitonic subsequence of size 3
Given an array arr[] of positive integers of size N, the task is to find the maximum product of bitonic subsequence of size 3.Bitonic Subsequence: subsequence in which elements are first in the increasing order and then decreasing order. Elements in the subsequence are follow this order arr[i] < arr[j] > arr[k] for i < j < k where i, j, k are the index of the given array.Note: If no such element is found then print -1....
read more
Minimize count of alternating subsequences to divide given Binary String with subsequence number
Given a binary string S of length N. The task is to find the following:...
read more
Make a given Binary String non-decreasing by removing the smallest subsequence
Given a binary string str of size N, the task is to find the length of the smallest subsequence such that after erasing the subsequence the resulting string will be the longest continuous non-decreasing string....
read more
Number of Longest Increasing Subsequences
Given an array arr[] of size N, the task is to count the number of longest increasing subsequences present in the given array....
read more
Minimum number of insertions required such that first K natural numbers can be obtained as sum of a subsequence of the array
Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the minimum number of elements that are required to be inserted such that all numbers from the range [1, K] can be obtained as the sum of any subsequence of the array....
read more
Maximum length Subsequence with alternating sign and maximum Sum
Given an array arr[] of size n having both positive and negative integer excluding zero. The task is to find the subsequence with an alternating sign having maximum size and maximum sum that is, in a subsequence sign of each adjacent element is opposite for example if the first one is positive then the second one has to be negative followed by another positive integer and so on.Examples:...
read more
Longest Uncommon Subsequence
Given two strings, find the length of longest uncommon subsequence of the two strings. The longest uncommon subsequence is defined as the longest subsequence of one of these strings which is not a subsequence of other strings....
read more
Count common subsequence in two strings
Given two string S and T. The task is to count the number of the common subsequence in S and T....
read more
Count minimum number of subsets (or subsequences) with consecutive numbers
Given an array of distinct positive numbers, the task is to calculate the number of subsets (or subsequences) from the array such that each subset contains consecutive numbers....
read more
Longest increasing sub-sequence formed by concatenating array to itself N times
Given an array arr[] of size N, the task is to find the length of the longest increasing subsequence in the array formed by the concatenation of the arr[] to itself at the end N times.Examples:...
read more