## Maximum sum such that no two elements are adjacent | Set 2

Given an array of positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be… Read More »

- Longest subsequence such that adjacent elements have at least one common digit
- Print all subsequences of a string using ArrayList
- Longest Ordered Subsequence of Vowels
- Sum of minimum element of all sub-sequences of a sorted array
- Find the lexicographically largest palindromic Subsequence of a String
- Find the longest subsequence of an array having LCM at most K
- Maximum sum such that no two elements are adjacent | Set 2
- Count number of sub-sequences with GCD 1
- Lexicographically largest sub-sequence of the given string
- Maximum sum possible for a sub-sequence such that no two elements appear at a distance < K in the array
- Divide array into increasing and decreasing subsequence without changing the order
- Number of subsequences with zero sum
- Longest Subsequence where index of next element is arr[arr[i] + i]
- Product of all Subsequences of size K except the minimum and maximum Elements
- Minimal product subsequence where adjacent elements are separated by a maximum distance of K
- Longest subsequence having greater corner values
- Count all sub-sequences having product <= K - Recursive approach
- Maximum number of removals of given subsequence from a string
- Minimum cost to make a string free of a subsequence

Given an array of positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be… Read More »

Given an array A[] containing N elements and an integer K. The task is to calculate the product of all elements of subsequences of size… Read More »

Given an array arr[] of N integers. The task is to count the number of sub-sequences whose sum is 0. Examples: Input: arr[] = {-1,… Read More »

Given a merged sequence which consists of two sequences which got merged, one of them was strictly increasing and the other was strictly decreasing. Elements… Read More »

Given an array arr[] of N elements and a positive integer K. The task is to find the longest sub-sequence in the array having LCM… Read More »

Given an array arr[] of n integers and an integer k, the task is to find the maximum sum possible for a sub-sequence such that… Read More »

Given an array arr[] and an integer K, the task is to find out the minimum product of a subsequence where adjacent elements of the… Read More »

Given a string str consisting of lowercase English alphabets and an array of positive integer arr[] both of same length. The task is to remove… Read More »

Given an array arr[] of N integers, the task is to find the length of the longest sub-sequence such that adjacent elements of the sub-sequence… Read More »

Given a sorted array A of n integers. The task is to find the sum of minimum of all possible subsequences of A. Note: Considering… Read More »

Given an array arr[] containing a random permutation of first N natural numbers, the task is to find the longest sub-sequence having the property that… Read More »

Given a string str containing lowercase characters, the task is to find the lexicographically largest sub-sequence of str. Examples: Input: str = “abc” Output: c… Read More »

Given a string . The task is to find the lexicographically largest subsequence of the string which is a palindrome. Examples: Input : str =… Read More »

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 an integer K and a non negative array arr[], the task is to find the number of sub-sequences having product ≤ K. This problem… Read More »