## Count number of sub-sequences with GCD 1

Given an array of N numbers, the task is to count the number of subsequences which have gcd equal to 1. Examples: Input: a[] =… Read More »

- Subset array sum by generating all the subsets
- Number of ways to partition a string into two balanced subsequences
- Count common subsequence in two strings
- Length of longest common subsequence containing vowels
- Find all distinct subset (or subsequence) sums of an array | Set-2
- Longest subsequence whose average is less than K
- Generating all possible Subsequences using Recursion
- Number of balanced bracket subsequence of length 2 and 4
- Longest Ordered Subsequence of Vowels
- Longest Subsequence with at least one common digit in every element
- Print all subsequences of a string using ArrayList
- Longest Subsequence where index of next element is arr[arr[i] + i]
- Check if there exists any sub-sequence in a string which is not palindrome
- Sum of width (max and min diff) of all Subsequences
- Count number of sub-sequences with GCD 1
- Maximum number of removals of given subsequence from a string
- Number of Permutations such that no Three Terms forms Increasing Subsequence
- Maximum length subsequence possible of the form R^N K^N
- Check if two same sub-sequences exist in a string or not

Given an array of N numbers, the task is to count the number of subsequences which have gcd equal to 1. Examples: Input: a[] =… Read More »

Given a string str, the task is to print all the sub-sequences of str. A subsequence is a sequence that can be derived from another… Read More »

Given a string str, the task is to count the maximum number of possible operations that can be performed on str. An operation consists of… Read More »

Given an array arr[], the task is to find the maximum length sub-sequence from the array which satisfy the following condition: Any element can be… Read More »

Given a string consisting of only vowels, find the longest subsequence in the given string such that it consists of all five vowels and is… Read More »

Given a string ‘S’ consisting of open and closed brackets, the task is find the number of ways in which each character of ‘S’ can… Read More »

Given an array A[] of integers. The task is to return the sum of the width of all subsequences of A. For any sequence S,… Read More »

Given a string of lowercase English alphabets. The task is to check if there exists any subsequence in the string which is not a palindrome.… Read More »

Given an array. The task is to find the length of the longest subsequence in which all elements must have at least one digit in… Read More »

Given an array of size N and a sum, the task is to check whether some array elements can be added to sum to N… Read More »

Given a bracket sequence of even length. The task is to find how many ways are there to make balanced bracket subsequences from the given… Read More »

Given two string S and Q. The task is to count the number of the common subsequence in S and T. Examples: Input : S… Read More »

Given an array. The task is to generate and print all of the possible subsequences of the given array using recursion. Examples: Input : [1,… Read More »

Given two strings X and Y of length m and n respectively. The problem is to find the length of the longest common subsequence of… Read More »

Given a number N. The task is to find the number of permutations of 1 to N such that no three terms of the permutation… Read More »