# Tag Archives: subsequence

Given an array A[] with size N, Select a subsequence B = {B, B, B, ………B[N] } of size M from given array A[]  (N… Read More
Given a binary string S consisting of ‘0‘ and ‘1‘ only, the task is to find the maximum possible number of “10” subsequences by replacing… Read More
Given an array arr[] of size N and a non-negative integer K, the task is to find the length of the longest subsequence such that… Read More
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
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, for each… 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