Given an array arr[] of positive numbers, the task is to find the minimum sum of a subsequence of maximum possible elements with the constraint… Read More

# Tag Archives: subsequence

Given an array of positive integers arr[] of length N and a query array query[] of length M, the task is to find the maximum… Read More

Given an array A[] of size N, the task is to maximize the frequency of any element by adding any positive integer X to all… Read More

Given an array of size N and two integers M and K., All the integers in the array are in the range [1, M]. Find… Read More

Given an integer array A[] of size N, the task is to check if the array can be divided into two subsequences such that appending… Read More

Given an integer N (N > 2), the task is to generate a binary string of size N that consists of equal numbers of “10”… Read More

Given a binary string S, the task is to find the longest subsequence with that has equal number of 0s and 1s and all the… Read More

Given a string S of size N, having lowercase alphabets, the task is to find the lexicographically minimum string after moving a subsequence to the… Read More

Given a string S of length N, the task is to find the number of unique subsequences of the string for each length from 0… Read More

Given an array arr[] of N strings, and Q queries where each of the queries contains some characters, the task is to check if for… Read More

Given two arrays, arr1[] of length N1 and arr2[] of length N2, consisting of numbers from 1 to 9 and arr1[] has some missing entries… Read More

Given an array A[] of size N and a digit K. Find the number of sub-sequences of the array where the last digit of the… Read More

Given an array arr[] and integer K, the task is to count the number of subsequences of the array such that after adding all the… Read More

Given an array A[] of N integers. Check if there exist 2 distinct sub-sequences X and Y of the given array, such that the sum… Read More

Given three strings, ‘X‘, ‘Y‘ and ‘Z‘, the task is to count the number of subsequences of ‘X‘ which is lexicographically greater than or equal… Read More