## Count number of increasing sub-sequences : O(NlogN)

Given an array arr[] of length N, the task is to find the number of strictly increasing sub-sequences in the given array. Examples: Input: arr[]… Read More »

## Longest sub-sequence of a binary string divisible by 3

Given a binary string S of length N, the task is to find the length of the longest sub-sequence in it which is divisible by… Read More »

## Number of subsequences with positive product

Given an array arr[] of N integers, the task is to find the count of all the subsequences of the array that have positive product.… Read More »

## Number of subsequences in a given binary string divisible by 2

Given a binary string str of length N, the task is to find the count of subsequences of str which are divisible by 2. Leading… Read More »

## Longest subsequence having difference atmost K

Given a string S of length N and an integer K, the task is to find the length of longest sub-sequence such that the difference… Read More »

## Longest Increasing Subsequence using BIT

Given an array arr, the task is to find the length of Longest Increasing Sequence using Binary Indexed Tree (BIT) Examples: Input: arr = {6,… Read More »

## Find the subsequence with given sum in a superincreasing sequence

A sequence of positive real numbers S1, S2, S3, …, SN is called a superincreasing sequence if every element of the sequence is greater than… Read More »

## Find the equal pairs of subsequence of S and subsequence of T

Given two arrays S[] and T[] of size N and M respectively. The task is to find the pairs of subsequences of S[] and subsequences… Read More »

## Number of subsequences of maximum length K containing no repeated elements

Given an array arr[] of N elements and a positive integer K such that K ≤ N. The task is to find the number of… Read More »

## Length of the longest subsequence such that xor of adjacent elements is non-decreasing

Given a sequence arr of N positive integers, the task is to find the length of the longest subsequence such that xor of adjacent integers… Read More »

## Longest subsequence with a given OR value : Dynamic Programming Approach

Given an array arr[], the task is to find the longest subsequence with a given OR value M. If there is no such sub-sequence then… Read More »

## Longest subsequence with a given AND value

Given an array arr[] and an integer M, the task is to find the longest subsequence with a given AND value M. If there is… Read More »

## Longest subsequence whose sum is divisible by a given number

Given an array arr[] and an integer M, the task is to find the length of the longest subsequence whose sum is divisible by M.… Read More »

## Longest subsequence with a given AND value | O(N)

Given an array arr[], the task is to find the longest subsequence with a given AND value M. If there is no such sub-sequence then… Read More »

## Longest sub-sequence with non-negative sum

Given an array arr[] of length N, the task is to find the length of the largest sub-sequence with non-negative sum. Examples: Input: arr[] =… Read More »